/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

int main() {
	mybintree<int>m;
	cout << m.IsEmpty() << " " << m.capacity() << endl;
	m.insert(1);
	m.insert(0);
	m.insert(2);
	cout << m.max() << " " << m.min() << " " << m.IsEmpty() << endl;
	return 0;
}
*///mybintree二叉树要测试的第一测试代码^
/*
//mybintree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class mybintree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		void set() {
			this->t = NULL;
			this->left = nullptr;
			this->right = nullptr;
		}
		void set(T tf, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
		}
	};
	node* root;
	int nodenf;
	node** returnnode;
	node** get_node(int index, node** findtree, int noden = 0) {
		if (ic >= 0 && index < ic && nullptr != findtree) {
			if (nullptr != (*findtree)->left) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->left, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
			if (index == noden++) {
				return findtree;
			}
			nodenf = noden;
			if (nullptr != (*findtree)->right) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->right, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
		}
		return nullptr;
	}
	void del_node(node** delnode) {
		node** findnode = (*delnode)->right;
		if (nullptr == findnode) {
			node** leftnode = (*delnode)->left;
			delete *delnode;
			*delnode = *leftnode;
		}
		else if (nullptr == (*findnode)->left) {
			(*delnode)->t = (*findnode)->t;
			delete *findnode;
			(*delnode)->right = nullptr;
		}
		else {
			while (nullptr != (*findnode)->left->left) {
				findnode = &(*findnode)->left;
			}
			(*delnode)->t = (*findnode)->left->t;
			delete (*findnode)->left;
			(*findnode)->left = nullptr;
		}
		ic--;
	}
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node;
					(*rootf)->right->set(t);
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node;
					(*rootf)->left->set(t);
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
		ic++;
	}
public:
	mybintree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int itemfind(T t) {
		for (int i = 0; i < ic; i++) {
			if ((*get_node(i, &root))->t == t) {
				return i;
			}
		}
		return -1;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mybintree& ml) {
		int ia = 0;
		node* findnode = ml.root;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->insert(findnode->t);
		}
	}
	mybintree(mybintree& ml) {
		*this = ml;
	}
	mybintree(const T tarr[], int has) {
		root = new node;
		root->set();
		for (int i = 0; i < has; i++) {
			insert(tarr[i]);
		}
	}
	void del_back() {
		if (ic) {
			if (nullptr == root->right) {
				root->t = NULL;
			}
			else {
				node** findnode = &root;
				while (nullptr != (*findnode)->right->right) {
					findnode = &(*findnode)->right;
				}
				node** delnode = &(*findnode)->right;
				(*findnode)->right = nullptr;
				delete* delnode;
			}
			ic--;
		}
	}
	void clear() {
		while (ic) {
			del_back();
		}
	}
	~mybintree() {
		clear();
		delete root;
	}
	void del_front(int index) {
		if (1 == ic) {
			root->t = NULL;
			ic--;
		}
		else if (ic){
			node** findnode = root->right;
			if (nullptr == findnode) {
				node** leftnode = root->left;
				delete root;
				root = *leftnode;
			}
			else if(nullptr == (*findnode)->left){
				root->t = (*findnode)->t;
				delete* findnode;
				root->right = nullptr;
			}
			else {
				while (nullptr != (*findnode)->left->left) {
					findnode = &(*findnode)->left;
				}
				root->t = (*findnode)->left->t;
				delete (*findnode)->left;
				(*findnode)->left = nullptr;
			}
			ic--;
		}
	}
	void del_index(int index) {
		del_node(get_node(index, &root));
	}
	bool IsEmpty() const {
		return !ic;
	}
	T at(int i) {
		return (*get_node(i, &root))->t;
	}
	T operator[](int i) {
		return at(i);
	}
	void printtree(void (*printfun)(T item, bool b)) {
		for (int i = 0; i < ic; i++) {
			printfun((*get_node(i, &root))->t, ic - 1 != i);
		}
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///修正之后的mybintree二叉树^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

int main() {
	mybintree<int>m;
	cout << m.IsEmpty() << " " << m.capacity() << endl;
	m.insert(1);
	m.insert(0);
	m.insert(2);
	m.insert(3);
	m.del_back();
	m.del_front();
	m.del_index(0);
	cout << m.IsEmpty() << " " << m.capacity() << " " << m[0] << " " << m[1] << endl;
	return 0;
}
*///mybintree二叉树要测试的第二测试代码^
/*
//mybintree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class mybintree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		void set() {
			this->t = NULL;
			this->left = nullptr;
			this->right = nullptr;
		}
		void set(T tf, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
		}
	};
	node* root;
	int nodenf;
	node** returnnode;
	node** get_node(int index, node** findtree, int noden = 0) {
		if (ic >= 0 && index < ic && nullptr != *findtree) {
			if (nullptr != (*findtree)->left) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->left, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
			if (index == noden++) {
				return findtree;
			}
			nodenf = noden;
			if (nullptr != (*findtree)->right) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->right, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
		}
		return nullptr;
	}
	void del_node(node** delnode) {
		node** findnode = &(*delnode)->right;
		if (nullptr == *findnode) {
			node* lefttree = (*delnode)->left;
			delete *delnode;
			*delnode = lefttree;
		}
		else if (nullptr == (*findnode)->left) {
			node* righttree = (*delnode)->right;
			delete *delnode;
			*delnode = righttree;
		}
		else {
			while (nullptr != (*findnode)->left->left) {
				findnode = &(*findnode)->left;
			}
			(*delnode)->t = (*findnode)->left->t;
			delete (*findnode)->left;
			(*findnode)->left = nullptr;
		}
		ic--;
	}
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node;
					(*rootf)->right->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node;
					(*rootf)->left->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
public:
	mybintree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int itemfind(T t) {
		for (int i = 0; i < ic; i++) {
			if ((*get_node(i, &root))->t == t) {
				return i;
			}
		}
		return -1;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mybintree& ml) {
		int ia = 0;
		node* findnode = ml.root;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->insert(findnode->t);
		}
	}
	mybintree(mybintree& ml) {
		*this = ml;
	}
	mybintree(const T tarr[], int has) {
		root = new node;
		root->set();
		for (int i = 0; i < has; i++) {
			insert(tarr[i]);
		}
	}
	void del_back() {
		if (ic) {
			if (nullptr == root->right) {
				root->t = NULL;
			}
			else {
				node** findnode = &root;
				while (nullptr != (*findnode)->right->right) {
					findnode = &(*findnode)->right;
				}
				node** delnode = &(*findnode)->right;
				(*findnode)->right = nullptr;
				delete* delnode;
			}
			ic--;
		}
	}
	void clear() {
		while (ic) {
			del_back();
		}
	}
	~mybintree() {
		clear();
		delete root;
	}
	void del_front() {
		del_node(get_node(0, &root));
	}
	void del_index(int index) {
		del_node(get_node(index, &root));
	}
	bool IsEmpty() const {
		return !ic;
	}
	T at(int i) {
		if (i >= 0 && ic > i) {
			return (*get_node(i, &root))->t;
		}
		else {
			return NULL;
		}
	}
	T operator[](int i) {
		return at(i);
	}
	void printtree(void (*printfun)(T item, bool b)) {
		for (int i = 0; i < ic; i++) {
			printfun((*get_node(i, &root))->t, ic - 1 != i);
		}
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///再一次修正之后的mybintree二叉树^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

void print(int item, bool b) {
	cout << item;
	b && cout << ", ";
}

int main() {
	mybintree<int>m;
	m.insert(1);
	m.insert(0);
	m.insert(2);
	m.insert(3);
	m.printtree(print);
	return 0;
}
*///没有任何问题的printtree方法^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

void print(int item, bool b) {
	cout << item;
	b && cout << ", ";
}

int main() {
	int arr[5] = { 1, 42, 4, 23, 5 };
	mybintree<int>m(arr, 5);
	m.printtree(print);
	return 0;
}
*///也没有任何问题的有参构造函数^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

void print(int item, bool b) {
	cout << item;
	b && cout << ", ";
}

int main() {
	int arr[5] = { 1, 4, 4, 3, 5 };
	mybintree<int>m(arr, 5);
	mybintree<int>ma = m;
	ma.printtree(print);
	return 0;
}
*///mybintree二叉树要测试的第五测试代码^
/*
//mybintree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class mybintree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		void set() {
			this->t = NULL;
			this->left = nullptr;
			this->right = nullptr;
		}
		void set(T tf, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
		}
	};
	node* root;
	int nodenf;
	node** returnnode;
	node** get_node(int index, node** findtree, int noden = 0) {
		if (ic >= 0 && index < ic && nullptr != *findtree) {
			if (nullptr != (*findtree)->left) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->left, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
			if (index == noden++) {
				return findtree;
			}
			nodenf = noden;
			if (nullptr != (*findtree)->right) {
				if (nullptr != (returnnode = get_node(index, &(*findtree)->right, noden))) {
					return returnnode;
				}
				noden = nodenf;
			}
		}
		return nullptr;
	}
	void del_node(node** delnode) {
		node** findnode = &(*delnode)->right;
		if (nullptr == *findnode) {
			node* lefttree = (*delnode)->left;
			delete *delnode;
			*delnode = lefttree;
		}
		else if (nullptr == (*findnode)->left) {
			node* righttree = (*delnode)->right;
			delete *delnode;
			*delnode = righttree;
		}
		else {
			while (nullptr != (*findnode)->left->left) {
				findnode = &(*findnode)->left;
			}
			(*delnode)->t = (*findnode)->left->t;
			delete (*findnode)->left;
			(*findnode)->left = nullptr;
		}
		ic--;
	}
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node;
					(*rootf)->right->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node;
					(*rootf)->left->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
public:
	mybintree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int itemfind(T t) {
		for (int i = 0; i < ic; i++) {
			if ((*get_node(i, &root))->t == t) {
				return i;
			}
		}
		return -1;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mybintree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	mybintree(mybintree& ml) {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
		*this = ml;
	}
	mybintree(const T tarr[], int has) {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
		for (int i = 0; i < has; i++) {
			insert(tarr[i]);
		}
	}
	void del_back() {
		if (ic) {
			if (nullptr == root->right) {
				root->t = NULL;
			}
			else {
				node** findnode = &root;
				while (nullptr != (*findnode)->right->right) {
					findnode = &(*findnode)->right;
				}
				node** delnode = &(*findnode)->right;
				(*findnode)->right = nullptr;
				delete* delnode;
			}
			ic--;
		}
	}
	void clear() {
		while (ic) {
			del_back();
		}
	}
	~mybintree() {
		clear();
		delete root;
	}
	void del_front() {
		del_node(get_node(0, &root));
	}
	void del_index(int index) {
		del_node(get_node(index, &root));
	}
	bool IsEmpty() const {
		return !ic;
	}
	T at(int i) {
		if (i >= 0 && ic > i) {
			return (*get_node(i, &root))->t;
		}
		else {
			return NULL;
		}
	}
	T operator[](int i) {
		return at(i);
	}
	void printtree(void (*printfun)(T item, bool b)) {
		for (int i = 0; i < ic; i++) {
			printfun((*get_node(i, &root))->t, ic - 1 != i);
		}
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///最后一次修正之后的mybintree二叉树^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

void print(int item, bool b) {
	cout << item;
	b && cout << ", ";
}

int main() {
	int arr[5] = { 1, 4, 4, 3, 5 };
	int i = 0;
	cout << "排序前的元素：";
	for (; i < 5; i++) {
		cout << arr[i];
		if (4 != i) {
			cout << ", ";
		}
		else {
			cout << endl;
		}
	}
	cout << "排序后的元素：";
	mybintree<int>m(arr, 5);
	m.printtree(print);
	return 0;
}
*///给元素进行排序的二叉树^
/*
//meiri.cpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

void print(int item, bool b) {
	cout << item;
	b && cout << ", ";
}

int main() {
	int arr[5] = { 1, 4, 4, 3, 5 };
	mybintree<int>m(arr, 5);
	cout << "请输入要查询的元素 -> ";
	int i = 0;
	int index = 0;
	cin >> i;
	if (-1 == (index = m.itemfind(i))) {
		cout << endl << endl << "你所查询的元素不存在" << endl;
	}
	else {
		cout << endl << endl << "你所查询的元素在mybintree二叉树m的第" << index << "项" << endl;
	}
	return 0;
}
*///查询元素是否存在的二叉树^
/*
//mybintree.hpp
#include <iostream>
#include "mybintree.hpp"
using namespace std;

int main() {
	int arr[5] = { 1, 4, 4, 3, 5 };
	mybintree<int>m(arr, 5);
	cout << "arr中最大数为" << m.max() << "，最小数为" << m.min() << endl;
	return 0;
}
*///查询最大值与最小值的二叉树^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <queue>
using namespace std;
class graph {
private:
	queue<int>*adj;
	int inodes;
	int iedges;
public:
	graph(int inodes);
	graph(graph& g);
	~graph();
	void link(int nodea, int nodeb);
	void dellink(int nodea, int nodeb);
	queue<int> getlink(int node);
	bool islink(int nodea, int nodeb);
};
*///已创建mygraph.h头文件^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(int inodes){

}
graph::graph(graph& g){

}
graph::~graph(){

}
void graph::link(int nodea, int nodeb){

}
void graph::dellink(int nodea, int nodeb){

}
queue<int> graph::getlink(int node){

}
bool graph::islink(int nodea, int nodeb){

}
*///已创建mygraph.cpp源文件^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new queue<int>[inodes];
}
graph::graph(graph& g){

}
graph::~graph(){
	delete[] adj;
}
void graph::link(int nodea, int nodeb){

}
void graph::dellink(int nodea, int nodeb){

}
queue<int> graph::getlink(int node){

}
bool graph::islink(int nodea, int nodeb){

}
*///已构建出mygraph无向图的构造方法及析构方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new queue<int>[inodes];
}
graph::graph(graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new queue<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(int nodea, int nodeb){

}
void graph::dellink(int nodea, int nodeb){

}
queue<int> graph::getlink(int node){

}
bool graph::islink(int nodea, int nodeb){

}
*///已构建出mygraph图中的拷贝构造方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(int nodea, int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(int nodea, int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(int node){

}
bool graph::islink(int nodea, int nodeb){

}
*///已实现mygraph图的link和dellink方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<int>* adj;
	int inodes;
	int iedges;
public:
	graph(int inodes);
	graph(graph& g);
	graph(vector<pair<int, int>> edges);
	graph(multimap<int, int> edges);
	~graph();
	void link(int nodea, int nodeb);
	void dellink(int nodea, int nodeb);
	vector<int> getlink(int node);
	bool islink(int nodea, int nodeb);
	vector<pair<int, int>> graphlink();
	void printlink(void (*printfun)(int nodea, int nodeb, bool isNotEnd));
};
*///已在mygraph.h里面新增了两个有参构造方法及两个方法^
/*
//mygraph.cpp
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<int>* adj;
	int inodes;
	int iedges;
public:
	graph(const int inodes);
	graph(const graph& g);
	~graph();
	void link(const int nodea, const int nodeb);
	void dellink(const int nodea, const int nodeb);
	vector<int> getlink (const int node) const;
	bool islink(const int nodea, const int nodeb) const;
	vector<pair<int, int>> graphlink();
	void printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const{

}
bool graph::islink(int nodea, int nodeb) const{

}
vector<pair<int, int>> graph::graphlink() {

}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {

}
*///已让大多数方法中的参数变为常量，并让大多数方法变为常方法，且删除了两个构造方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const{
	return adj[node];
}
bool graph::islink(const int nodea, const int nodeb) const{

}
vector<pair<int, int>> graph::graphlink() {

}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {

}
*///已实现mygraph图中的getlink方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const{
	return adj[node];
}
bool graph::islink(const int nodea, const int nodeb) const{

}
vector<pair<int, int>> graph::graphlink() {
	vector<pair<int, int>> v;
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {

}
*///已实现mygraph图中的graphlink方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const{
	return adj[node];
}
bool graph::islink(const int nodea, const int nodeb) const{

}
vector<pair<int, int>> graph::graphlink() {
	vector<pair<int, int>> v;
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
*///已实现mygraph图的printlink方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<int>* adj;
	int inodes;
	int iedges;
public:
	graph(const int inodes);
	graph(const graph& g);
	~graph();
	void link(const int nodea, const int nodeb);
	void dellink(const int nodea, const int nodeb);
	vector<int> getlink (const int node) const;
	bool islink(const int nodea, const int nodeb) const;
	bool islink(const int nodea, const int nodeb, vector<int> linknodes) const;
	vector<pair<int, int>> graphlink();
	void printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const{
	return adj[node];
}
bool graph::islink(const int nodea, const int nodeb) const{

}
bool graph::islink(const int nodea, const int nodeb, vector<int> linknodes) const {

}
vector<pair<int, int>> graph::graphlink() {
	vector<pair<int, int>> v;
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
*///已新增一个islink的重载方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<int>* adj;
	int inodes;
	int iedges;
	bool islink(const int nodea, const int nodeb, bool linknodes[]) const;
public:
	graph(const int inodes);
	graph(const graph& g);
	~graph();
	void link(const int nodea, const int nodeb);
	void dellink(const int nodea, const int nodeb);
	vector<int> getlink (const int node) const;
	bool islink(const int nodea, const int nodeb) const;
	vector<pair<int, int>> graphlink();
	void printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const;
};
*///已将一个方法转为私有方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<int>* adj;
	int inodes;
	int iedges;
	bool islink(const int nodea, const int nodeb, bool** linknodes);
public:
	graph(const int inodes);
	graph(const graph& g);
	~graph();
	void link(const int nodea, const int nodeb);
	void dellink(const int nodea, const int nodeb);
	vector<int> getlink (const int node) const;
	bool islink(const int nodea, const int nodeb);
	vector<pair<int, int>> graphlink();
	void printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const int nodea, const int nodeb){
	for (vector<int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<int> graph::getlink(const int node) const {
	return adj[node];
}
bool graph::islink(const int nodea, const int nodeb) {
	bool* linknodes = new bool[inodes];
	islink(nodea, nodeb, &linknodes);
	delete linknodes;
}
bool graph::islink(const int nodea, const int nodeb, bool** linknodes) {
	(*linknodes)[nodea] = 1;
	for (vector<int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!(*linknodes)[*it] && (*it == nodeb || islink(*it, nodeb, linknodes))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<int, int>> graph::graphlink() {
	vector<pair<int, int>> v;
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const int nodea, const int nodeb, const bool isNotEnd)) const {
	int i = 0;
	int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
*///已改变mygraph图中islink私有重载方法的参数与islink公开方法的实现，并实现好了islink私有重载方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<unsigned int>* adj;
	int inodes;
	int iedges;
	bool islink(const unsigned int nodea, const unsigned int nodeb, bool** linknodes);
public:
	graph(const unsigned int inodes);
	graph(const graph& g);
	~graph();
	void link(const unsigned int nodea, const unsigned int nodeb);
	void dellink(const unsigned int nodea, const unsigned int nodeb);
	vector<unsigned int> getlink (const unsigned int node) const;
	bool islink(const unsigned int nodea, const unsigned int nodeb);
	vector<pair<unsigned int, unsigned int>> graphlink();
	void printlink(const void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const unsigned int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<unsigned int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<unsigned int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<unsigned int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<unsigned int> graph::getlink(const unsigned int node) const {
	return adj[node];
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb) {
	bool* linknodes = new bool[inodes];
	islink(nodea, nodeb, &linknodes);
	delete[] linknodes;
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb, bool** linknodes) {
	(*linknodes)[nodea] = 1;
	for (vector<unsigned int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!(*linknodes)[*it] && (*it == nodeb || islink(*it, nodeb, linknodes))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<unsigned int, unsigned int>> graph::graphlink() {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const {
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
*///已将mygrpah.h及mygraph.cpp中的多处“int”改为“unsigned int”^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<unsigned int>* adj;
	unsigned int inodes;
	unsigned int iedges;
	bool islink(const unsigned int nodea, const unsigned int nodeb, bool** linknodes);
public:
	graph(const unsigned int inodes);
	graph(const graph& g);
	~graph();
	void link(const unsigned int nodea, const unsigned int nodeb);
	void dellink(const unsigned int nodea, const unsigned int nodeb);
	vector<unsigned int> getlink (const unsigned int node) const;
	bool islink(const unsigned int nodea, const unsigned int nodeb);
	vector<pair<unsigned int, unsigned int>> graphlink();
	void printlink(const void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const unsigned int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<unsigned int>[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<unsigned int>[inodes];
}
graph::~graph(){
	delete[] adj;
}
void graph::link(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<unsigned int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<unsigned int> graph::getlink(const unsigned int node) const {
	return adj[node];
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb) {
	bool* linknodes = new bool[inodes];
	bool b = islink(nodea, nodeb, &linknodes);
	delete[] linknodes;
	return b;
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb, bool** linknodes) {
	(*linknodes)[nodea] = 1;
	for (vector<unsigned int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!(*linknodes)[*it] && (*it == nodeb || islink(*it, nodeb, linknodes))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<unsigned int, unsigned int>> graph::graphlink() {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const {
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
*///已在mygraph图中改变某些私有变量的类型，并在mygraph.cpp中修正了islink公开方法无返回值的bug^
/*
//meiri.cpp
#include <iostream>
#include "mygraph.h"
using namespace std;

int main() {
	graph g(5);
	g.link(0, 1);
	cout << "0 - " << g.getlink(0)[0] << ", 1 - " << g.getlink(1)[0];
	return 0;
}
*///已测试mygraph图中的link与getlink方法^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(const unsigned int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<unsigned int>[inodes];
	linknodes = new bool[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<unsigned int>[inodes];
	linknodes = new bool[inodes];
}
graph::~graph(){
	delete[] adj;
	delete[] linknodes;
}
void graph::link(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<unsigned int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<unsigned int> graph::getlink(const unsigned int node) const {
	return adj[node];
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb) {
	for (int i = 0; i < inodes; i++) {
		linknodes[i] = 0;
	}
	return islink(nodea, nodeb, 0);
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb, bool) {
	linknodes[nodea] = 1;
	for (vector<unsigned int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!linknodes[*it] && (*it == nodeb || islink(*it, nodeb, 0))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<unsigned int, unsigned int>> graph::graphlink() {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(const void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const {
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
//meiri.cpp
#include <iostream>
#include "mygraph.h"
using namespace std;

int main() {
	graph g(5);
	g.link(0, 1);
	g.link(1, 4);
	g.link(0, 4);
	g.link(1, 2);
	vector<pair<unsigned int, unsigned int>>v = g.graphlink();
	for (auto it = v.begin(); v.end() != it; it++) {
		cout << it->first << "-" << it->second << endl;
	}
	cout << endl;
	for (int i = 1; i < 5; i++) {
		cout << "0 -> " << i << "?  --------  " << (g.islink(0, i) ? "true" : "false") << endl;
	}
	return 0;
}
*///已测试mygraph图中的graphlink与islink方法，并修正了gpaphlink方法^
/*
//mygraph.h
#pragma once
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class graph {
private:
	vector<unsigned int>* adj;
	bool* linknodes;
	unsigned int inodes;
	unsigned int iedges;
	bool islink(const unsigned int nodea, const unsigned int nodeb, bool);
public:
	graph(const unsigned int inodes);
	graph(const graph& g);
	~graph();
	void link(const unsigned int nodea, const unsigned int nodeb);
	void dellink(const unsigned int nodea, const unsigned int nodeb);
	vector<unsigned int> getlink (const unsigned int node) const;
	bool islink(const unsigned int nodea, const unsigned int nodeb);
	vector<pair<unsigned int, unsigned int>> graphlink();
	void printlink(void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const;
};
//mygraph.cpp
#include "mygraph.h"
graph::graph(const unsigned int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<unsigned int>[inodes];
	linknodes = new bool[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new vector<unsigned int>[inodes];
	linknodes = new bool[inodes];
}
graph::~graph(){
	delete[] adj;
	delete[] linknodes;
}
void graph::link(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<unsigned int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<unsigned int> graph::getlink(const unsigned int node) const {
	return adj[node];
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb) {
	for (int i = 0; i < inodes; i++) {
		linknodes[i] = 0;
	}
	return islink(nodea, nodeb, 0);
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb, bool) {
	linknodes[nodea] = 1;
	for (vector<unsigned int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!linknodes[*it] && (*it == nodeb || islink(*it, nodeb, 0))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<unsigned int, unsigned int>> graph::graphlink() {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const {
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				printfun(i, adj[i][ia], inodes - 1 != i || adj[i].size() - 1 != ia);
			}
		}
	}
}
//meiri.cpp
#include <iostream>
#include "mygraph.h"
using namespace std;

void print(unsigned int i, unsigned int ia, bool b) {
	cout << i << " - " << ia << endl;
}

int main() {
	graph g(2);
	graph ga = g;
	cout << g.graphlink().size() << " ";
	g.dellink(0, 1);
	g.dellink(1, 0);
	ga.link(0, 1);
	cout << ga.graphlink().size() << " ";
	ga.dellink(0, 1);
	ga.dellink(1, 0);
	cout << ga.graphlink().size() << " ";
	ga.printlink(print);
	return 0;
}
*///已测试mygraph图中的dellink方法，printlink方法与拷贝方法，并使printlink方法的形参重新修正过来了^
/*
//mygraph.cpp
#include "mygraph.h"
graph::graph(const unsigned int inodesf){
	inodes = inodesf;
	iedges = 0;
	adj = new vector<unsigned int>[inodes];
	linknodes = new bool[inodes];
}
graph::graph(const graph& g){
	inodes = g.inodes;
	iedges = g.iedges;
	adj = new (vector<unsigned int>[inodes]);
	linknodes = new bool[inodes];
}
graph::~graph(){
	delete[] adj;
	delete[] linknodes;
}
void graph::link(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			return;
		}
	}
	adj[nodea].push_back(nodeb);
	adj[nodeb].push_back(nodea);
}
void graph::dellink(const unsigned int nodea, const unsigned int nodeb){
	for (vector<unsigned int>::iterator it = adj[nodea].begin(); adj[nodea].end() != it; it++) {
		if (*it == nodeb) {
			adj[nodea].erase(it);
			break;
		}
	}
	for (vector<unsigned int>::iterator it = adj[nodeb].begin(); adj[nodeb].end() != it; it++) {
		if (*it == nodea) {
			adj[nodeb].erase(it);
			break;
		}
	}
}
vector<unsigned int> graph::getlink(const unsigned int node) const {
	return adj[node];
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb) {
	for (int i = 0; i < inodes; i++) {
		linknodes[i] = 0;
	}
	return islink(nodea, nodeb, 0);
}
bool graph::islink(const unsigned int nodea, const unsigned int nodeb, bool) {
	linknodes[nodea] = 1;
	for (vector<unsigned int>::const_iterator it = adj[nodea].cbegin(); adj[nodea].cend() != it; it++) {
		if (!linknodes[*it] && (*it == nodeb || islink(*it, nodeb, 0))) {
			return 1;
		}
	}
	return 0;
}
vector<pair<unsigned int, unsigned int>> graph::graphlink() {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	return v;
}
void graph::printlink(void (*printfun)(const unsigned int nodea, const unsigned int nodeb, const bool isNotEnd)) const {
	vector<pair<unsigned int, unsigned int>> v;
	unsigned int i = 0;
	unsigned int ia = 0;
	for (; i < inodes; i++) {
		for (ia = 0; ia < adj[i].size(); ia++) {
			if (i < adj[i][ia]) {
				v.push_back({ i, adj[i][ia] });
			}
		}
	}
	for (auto it = v.cbegin(); v.cend() != it; it++) {
		printfun(it->first, it->second, v.cend() - 1 != it);
	}
}
//meiri.cpp
#include <iostream>
#include "mygraph.h"
using namespace std;

void print(unsigned int i, unsigned int ia, bool b) {
	cout << i << " - " << ia << endl;
}

void printa(unsigned int i, unsigned int ia, bool b) {
	cout << i << " - " << ia;
	b && (cout << ", "), b || (cout << endl);
}

int main() {
	graph g(5);
	g.link(0, 4);
	g.link(1, 2);
	g.link(0, 1);
	g.link(3, 2);
	g.link(2, 4);
	g.link(0, 2);
	g.link(3, 4);
	g.printlink(print);
	cout << endl;
	g.printlink(printa);
	return 0;
}
*///已深度测试mygraph图中的printlink方法，并修正了printlink方法的实现^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mylist {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mylist() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	void push(T t) {
		
	}
	int capacity() const {
		return ic;
	}
	void operator=(mylist& ml) {
		int ia = 0;
		node* findnode = ml.head;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->push(findnode->t);
		}
	}
	mylist(mylist& ml) {
		*this = ml;
	}
	mylist(const T tarr[], int has) {
		head = new node;
		head->set();
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	void pop() {
		if (ic) {
			
			ic--;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mylist() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printlist(void (*printfun)(T item, bool b)) {
		if (ic) {
			
		}
	}
};
*///已创建mystack.hpp文件^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mylist {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mylist() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mylist& ml) {
		int ia = 0;
		node* findnode = ml.head;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->push(findnode->t);
		}
	}
	mylist(mylist& ml) {
		*this = ml;
	}
	mylist(const T tarr[], int has) {
		head = new node;
		head->set();
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* newnode = head->next->next;
			tpop = head->next->item;
			delete head->next;
			head->next = newnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mylist() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printlist(void (*printfun)(T item, bool b)) {
		if (ic) {
			
		}
	}
};
*///已实现mystack栈中的push与pop方法^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mylist {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mylist() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mylist& ml) {
		int ia = 0;
		node* findnode = ml.head;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->push(findnode->t);
		}
	}
	mylist(mylist& ml) {
		*this = ml;
	}
	mylist(const T tarr[], int has) {
		head = new node;
		head->set();
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* newnode = head->next->next;
			tpop = head->next->item;
			delete head->next;
			head->next = newnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mylist() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printlist(void (*printfun)(T item, bool IsNotEnd)) {
		if (ic) {
			node* printnode = root->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
*///已实现mystack栈中的printlist方法^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mystack {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mystack() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mystack& ml) {
		int ia = 0;
		node* findnode = ml.head;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->push(findnode->t);
		}
	}
	mystack(mystack& ml) {
		*this = ml;
	}
	mystack(const T tarr[], int has) {
		head = new node;
		head->set();
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* newnode = head->next->next;
			tpop = head->next->item;
			delete head->next;
			head->next = newnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	T top() {
		if (ic) {
			return head->next->item;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mystack() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printstack(void (*printfun)(T item, bool IsNotEnd)) {
		if (ic) {
			node* printnode = root->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
*///已新建并实现了mystack栈的top方法^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mystack {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mystack() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mystack& ml) {
		int ia = 0;
		node* findnode = ml.head;
		for (int i = 0; i < ml.ic; i++) {
			findnode = findnode->next;
			this->push(findnode->t);
		}
	}
	mystack(mystack& ml) {
		*this = ml;
	}
	mystack(const T tarr[], int has) {
		head = new node;
		head->set();
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* nextnode = head->next->next;
			tpop = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	T top() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mystack() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printstack(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
//meiri.cpp
#include <iostream>
#include "mystack.hpp"
#include <stack>
using namespace std;

int main() {
	mystack<int>s;
	int i = 1234;
	cout << s.capacity() << endl << endl << "反转前：";
	while (i) {
		cout << s.push(i) << " ";
		i /= 10;
	}
	cout << endl << s.capacity() << endl << endl << "反转后：";
	while (!s.IsEmpty()) {
		cout << s.pop() << " ";
	}
	cout << endl << s.capacity() << endl;
	return 0;
}
*///已测试好mystack栈的capacity方法，push方法，IsEmpty方法与pop方法^
/*
//mystack.hpp
#pragma once
#include <iostream>
#include <stack>
using namespace std;
template<class T>
class mystack {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mystack() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mystack& ml) {
		this->clear();
		T* arr = new T[ml.ic];
		node* addnode = ml.head->next;
		for (int i = 0; i < ml.ic; i++) {
			arr[i] = addnode->t;
			addnode = addnode->next;
		}
		for (int i = ml.ic - 1; i >= 0; i--) {
			this->push(arr[i]);
		}
	}
	mystack(mystack& ml) {
		head = new node;
		head->set();
		this->ic = 0;
		*this = ml;
	}
	mystack(const T tarr[], int has) {
		head = new node;
		head->set();
		this->ic = 0;
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* nextnode = head->next->next;
			tpop = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	T top() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mystack() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printstack(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
//meiri.cpp
#include <iostream>
#include "mystack.hpp"
#include <stack>
using namespace std;

void print(int i, bool b) {
	cout << i << " ";
}

int main() {
	int arr[4] = { 1234, 123, 12, 1 };
	mystack<int>sa(arr, 4);
	mystack<int>s = sa;
	cout << s.capacity() << endl << endl << "反转后：";
	s.printstack(print);
	cout << endl << s.top() << endl;
	s.clear();
	cout << s.top() << endl;
	cout << endl << s.capacity() << endl;
	return 0;
}
*///已测试好mystack的拷贝构造方法，有参构造方法，printstack方法，top方法与clear方法0，并修正了拷贝构造方法的实现^
/*
//meiri.cpp
#include <iostream>
#include "mystack.hpp"
#include <stack>
using namespace std;

void print(int i, bool b) {
	cout << i;
	if (b) {
		cout << ", ";
	}
}

int main() {
	int arr[4] = { 1234, 123, 12, 1 };
	mystack<int>s(arr, 4);
	s.printstack(print);
	return 0;
}*
*///已测试好mystack栈的所有方法^
/*
//mystack.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mystack {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	mystack() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, head->next);
		head->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(mystack& ml) {
		this->clear();
		T* arr = new T[ml.ic];
		node* addnode = ml.head->next;
		for (int i = 0; i < ml.ic; i++) {
			arr[i] = addnode->t;
			addnode = addnode->next;
		}
		for (int i = ml.ic - 1; i >= 0; i--) {
			this->push(arr[i]);
		}
	}
	mystack(mystack& ml) {
		head = new node;
		head->set();
		this->ic = 0;
		*this = ml;
	}
	mystack(const T tarr[], int has) {
		head = new node;
		head->set();
		this->ic = 0;
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tpop = NULL;
			node* nextnode = head->next->next;
			tpop = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tpop;
		}
		else {
			return NULL;
		}
	}
	T top() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~mystack() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printstack(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
//myqueue.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class myqueue {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	myqueue() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(myqueue& ml) {
		this->clear();
		T* arr = new T[ml.ic];
		node* addnode = ml.head->next;
		for (int i = 0; i < ml.ic; i++) {
			arr[i] = addnode->t;
			addnode = addnode->next;
		}
		for (int i = ml.ic - 1; i >= 0; i--) {
			this->push(arr[i]);
		}
	}
	myqueue(myqueue& ml) {
		head = new node;
		head->set();
		this->ic = 0;
		*this = ml;
	}
	myqueue(const T tarr[], int has) {
		head = new node;
		head->set();
		this->ic = 0;
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tfront = NULL;
			node* nextnode = head->next->next;
			tfront = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tfront;
		}
		else {
			return NULL;
		}
	}
	T front() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~myqueue() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printqueue(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
*///已修改mystack栈中导入的头文件，并已构建好myqueue队列的一些方法^
/*
//myqueue.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class myqueue {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	myqueue() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, nullptr);
		node** lastnode = &head;
		while (nullptr != (*lastnode)->next) {
			lastnode = &(*lastnode)->next;
		}
		(*lastnode)->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(myqueue& ml) {
		this->clear();
		T* arr = new T[ml.ic];
		node* addnode = ml.head->next;
		for (int i = 0; i < ml.ic; i++) {
			arr[i] = addnode->t;
			addnode = addnode->next;
		}
		for (int i = ml.ic - 1; i >= 0; i--) {
			this->push(arr[i]);
		}
	}
	myqueue(myqueue& ml) {
		head = new node;
		head->set();
		this->ic = 0;
		*this = ml;
	}
	myqueue(const T tarr[], int has) {
		head = new node;
		head->set();
		this->ic = 0;
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tfront = NULL;
			node* nextnode = head->next->next;
			tfront = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tfront;
		}
		else {
			return NULL;
		}
	}
	T front() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~myqueue() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printqueue(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
*///已实现myqueue队列的入队方法^
/*
//myqueue.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class myqueue {
private:
	int ic;
	class node {
	public:
		T t;
		node* next;
		void set() {
			this->t = NULL;
			this->next = nullptr;
		}
		void set(T tf, node* nextf) {
			this->t = tf;
			this->next = nextf;
		}
	};
	node* head;
public:
	myqueue() {
		head = new node;
		head->set();
		this->ic = 0;
	}
	T push(T t) {
		node* addnode = new node;
		addnode->set(t, nullptr);
		node** lastnode = &head;
		while (nullptr != (*lastnode)->next) {
			lastnode = &(*lastnode)->next;
		}
		(*lastnode)->next = addnode;
		ic++;
		return t;
	}
	int capacity() const {
		return ic;
	}
	void operator=(myqueue& ml) {
		this->clear();
		node* addnode = ml.head;
		while (nullptr != addnode->next) {
			addnode = addnode->next;
			this->push(addnode->t);
		}
	}
	myqueue(myqueue& ml) {
		head = new node;
		head->set();
		this->ic = 0;
		*this = ml;
	}
	myqueue(const T tarr[], int has) {
		head = new node;
		head->set();
		this->ic = 0;
		if (sizeof * tarr) {
			const T* tp = tarr;
			for (int i = 0; i < has; i++) {
				push(*tp++);
			}
		}
	}
	T pop() {
		if (ic) {
			T tfront = NULL;
			node* nextnode = head->next->next;
			tfront = head->next->t;
			delete head->next;
			head->next = nextnode;
			ic--;
			return tfront;
		}
		else {
			return NULL;
		}
	}
	T front() {
		if (ic) {
			return head->next->t;
		}
		else {
			return NULL;
		}
	}
	void clear() {
		while (ic) {
			pop();
		}
	}
	~myqueue() {
		clear();
		delete head;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printqueue(void (*printfun)(T t, bool IsNotEnd)) {
		if (ic) {
			node* printnode = head->next;
			while (nullptr != printnode) {
				printfun(printnode->t, nullptr != printnode->next);
				printnode = printnode->next;
			}
		}
	}
};
*///已修正myqueue队列的拷贝构造方法^
/*
//meiri.cpp
#include <iostream>
#include "myqueue.hpp"
using namespace std;

void print(int i, bool b) {
	cout << i;
	if (b) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[4] = { 1234, 123, 12, 1 };
	myqueue<int>qa(arr, 4);
	myqueue<int>q = qa;
	q.printqueue(print);
	q.pop();
	q.printqueue(print);
	q.clear();
	q.printqueue(print);
	return 0;
}
*///已测试好queue队列的printqueue方法，pop方法，push方法，拷贝构造方法与clear方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {

	}
	T getMax() {

	}
	T delMax() {

	}
	void clear() {

	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {

	}
	void sink(int inode) {

	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已创建myheap.hpp类文件^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {

	}
	T getMax() {

	}
	T delMax() {

	}
	void clear() {

	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {

	}
	void sink(int inode) {

	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已声明并实现出myheap堆的swap方法^
/*
//myheap.cpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {

	}
	T getMax() {

	}
	T delMax() {

	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {

	}
	void sink(int inode) {

	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现myheap堆的clear清空方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {

	}
	T getMax() {
		return tarr[0];
	}
	T delMax() {

	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {

	}
	void sink(int inode) {

	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现myheap堆的getMax方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {
		nodearr[++inodenum] = item;
		swim(inodenum);
	}
	T getMax() {
		return nodearr[0];
	}
	T delMax() {

	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {
		if (inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {

	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现myheap堆的swim方法与insert方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {
		nodearr[++inodenum] = item;
		swim(inodenum);
	}
	T getMax() {
		return nodearr[0];
	}
	T delMax() {
		if (inodenum) {
			nodearr[0] = nodearr[inodenum--];
			nodearr[inodenum + 1] = NULL;
			inodenum--;
			sink(0);
		}
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {
		if (inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现myheap堆的delMax方法与sink方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], int has) {

	}
	myheap(myheap& heap) {

	}
	T insert(T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[0];
	}
	T delMax() {
		t max = NULL;
		if (inodenum) {
			nodearr[0] = nodearr[inodenum--];
			max = nodearr[0];
			nodearr[inodenum + 1] = NULL;
			inodenum--;
			sink(0);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {
		if (inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已修正myheap堆的insert方法与delMax方法没有返回值的问题，并为insert方法增加了一个限制条件^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], int has) {
		this->ic = ihas;
		this->inodenum = 0;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < ihas; i++) {
			this->insert(tarr[i]);
		}
	}
	myheap(myheap& heap) {
		*this = heap;
	}
	void operator=(myheap& heap) {
		static bool bcreate = false;
		if (bcreate) {
			this->clear();
			delete[] this->nodearr;
		}
		this->ic = heap.ic;
		this->inodenum = heap.inodenum;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < this->ic; i++) {
			this->nodearr[i + 1] = heap->nodearr[i + 1];
		}
		bcreate = true;
	}
	T insert(T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[0];
	}
	T delMax() {
		t max = NULL;
		if (inodenum) {
			nodearr[0] = nodearr[inodenum--];
			max = nodearr[0];
			nodearr[inodenum + 1] = NULL;
			inodenum--;
			sink(0);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {
		if (inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap() {
		
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现myheap堆的有参构造方法和拷贝构造方法，并重载了赋值运算符^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	void swap(int nodea, int nodeb) {
		int nodetemp = nodea;
		nodea = nodeb;
		nodeb = nodetemp;
	}
public:
	myheap(int icapacity) {
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], int has) {
		this->ic = ihas;
		this->inodenum = 0;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < ihas; i++) {
			this->insert(tarr[i]);
		}
	}
	myheap(myheap& heap) {
		*this = heap;
	}
	void operator=(myheap& heap) {
		static bool bcreate = false;
		if (bcreate) {
			this->clear();
			delete[] this->nodearr;
		}
		this->ic = heap.ic;
		this->inodenum = heap.inodenum;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < this->ic; i++) {
			this->nodearr[i + 1] = heap->nodearr[i + 1];
		}
		bcreate = true;
	}
	T insert(T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[0];
	}
	T delMax() {
		t max = NULL;
		if (inodenum) {
			nodearr[0] = nodearr[inodenum--];
			max = nodearr[0];
			nodearr[inodenum + 1] = NULL;
			inodenum--;
			sink(0);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i + 1] = NULL;
		}
		inodenum = 0;
	}
	int capacity() {
		return ic;
	}
	int nodenum() {
		return inodenum;
	}
	void swim(int inode) {
		if (inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap(void (*printfun)(T, bool)) {
		for (int i = 0; i < ic; i++) {
			printfun(nodearr[i + 1], i + 1 != ic);
		}
	}
	~myheap() {
		delete[] nodearr;
	}
};
*///已实现了myheap堆的printfun方法^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	bool bcreate;
	void swap(const int nodea, const int nodeb) {
		int nodetemp = nodearr[nodea];
		nodearr[nodea] = nodearr[nodeb];
		nodearr[nodeb] = nodetemp;
	}
public:
	myheap(const int icapacity) {
		this->bcreate = false;
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
	}
	myheap(const T tarr[], const int ihas) {
		this->bcreate = false;
		this->ic = ihas;
		this->inodenum = 0;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < ihas; i++) {
			this->insert(tarr[i]);
		}
	}
	myheap(myheap& heap) {
		this->bcreate = false;
		*this = heap;
	}
	void operator=(myheap& heap) {
		if (this->bcreate) {
			this->clear();
			delete[] this->nodearr;
		}
		this->ic = heap.ic;
		this->inodenum = heap.inodenum;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < this->ic; i++) {
			this->nodearr[i + 1] = heap.nodearr[i + 1];
		}
		this->bcreate = true;
	}
	T insert(const T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[1];
	}
	T delMax() {
		T max = NULL;
		if (inodenum) {
			max = nodearr[1];
			nodearr[1] = nodearr[inodenum--];
			nodearr[inodenum + 1] = NULL;
			sink(1);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i + 1] = NULL;
		}
		inodenum = 0;
	}
	int capacity() const {
		return ic;
	}
	int nodenum() const {
		return inodenum;
	}
	void swim(int inode) {
		if (0 < inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap(void (*printfun)(T, bool)) {
		for (int i = 0; i < ic; i++) {
			printfun(nodearr[i + 1], i + 1 != ic);
		}
	}
	~myheap() {
		delete[] nodearr;
	}
};
//meiri.cpp
#include <iostream>
#include "myheap.hpp"
using namespace std;

void print(int i, bool b) {
	cout << i;
	if (b) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[5] = { 1, 2, 3, 4, 5 };
	myheap<int>ha(arr, 5);
	myheap<int>h = ha;
	myheap<int>hb(3);
	hb = h;
	h.printheap(print);
	hb.printheap(print);
	cout << h.getMax() << ", " << (h.getMax() == h.delMax()) << endl;
	cout << h.capacity() << ", " << h.nodenum() << ", " << h.delMax() << endl;
	h.clear();
	cout << h.nodenum() << endl;
	return 0;
}
*///已基本测试了myheap堆的有参构造方法，拷贝构造方法，赋值运算符，printheap方法，getMax方法，delMax方法，capacity方法，insert方法，swim方法，sink方法，nodenum方法和clear方法，并修正了这些方法中的大多数^
/*
#include <iostream>
using namespace std;
int main() {
	int ia = 5;
	int ib = 3;
	bool bifs[3] = { ib < ia, 5 == ia, 4 > ib };
	for (int i = 0; i < 3; i++) {
		switch ((!bifs[i]) * 3 + i) {
		case 0:
			cout << "0" << endl;
			i = 3;
			break;
		case 1:
			cout << "1" << endl;
			i = 3;
			break;
		case 2:
			cout << "2" << endl;
			i = 3;
			break;
		default:
			break;
		}
	}
	return 0;
}
*///奇怪的用switch语句代替if-else语句的程序^
/*
//myheap.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	bool bcreate;
	void swap(const int nodea, const int nodeb) {
		int nodetemp = nodearr[nodea];
		nodearr[nodea] = nodearr[nodeb];
		nodearr[nodeb] = nodetemp;
	}
public:
	myheap(const int icapacity) {
		this->bcreate = false;
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
		for (int i = 1; i <= this->ic; i++) {
			nodearr[i] = 0;
		}
	}
	myheap(const T tarr[], const int ihas) {
		this->bcreate = false;
		this->ic = ihas;
		this->inodenum = 0;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < ihas; i++) {
			this->insert(tarr[i]);
		}
	}
	myheap(myheap& heap) {
		this->bcreate = false;
		*this = heap;
	}
	void operator=(myheap& heap) {
		if (this->bcreate) {
			this->clear();
			delete[] this->nodearr;
		}
		this->ic = heap.ic;
		this->inodenum = heap.inodenum;
		this->nodearr = new T[ic + 1];
		for (int i = 0; i < this->ic; i++) {
			this->nodearr[i + 1] = heap.nodearr[i + 1];
		}
		this->bcreate = true;
	}
	T insert(const T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[1];
	}
	T delMax() {
		T max = NULL;
		if (inodenum) {
			max = nodearr[1];
			nodearr[1] = nodearr[inodenum--];
			nodearr[inodenum + 1] = NULL;
			sink(1);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i + 1] = NULL;
		}
		inodenum = 0;
	}
	int capacity() const {
		return ic;
	}
	int nodenum() const {
		return inodenum;
	}
	void swim(int inode) {
		if (0 < inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 < inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 >= inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 < inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap(void (*printfun)(T, bool)) {
		for (int i = 0; i < ic; i++) {
			printfun(nodearr[i + 1], i + 1 != ic);
		}
	}
	~myheap() {
		delete[] nodearr;
	}
};
//meiri.cpp
#include <iostream>
#include "myheap.hpp"
using namespace std;

void print(int i, bool b) {
	cout << i;
	if (b) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	myheap<int>h(1);
	cout << h.getMax() << endl;
    cout << h.delMax() << endl;
	for (int i = 1; i <= 2; i++) {
		cout << h.insert(i) << " ";
	}
	cout << endl;
	return 0;
}
*///已测试myheap堆的按容量构造的构造方法，getMax方法，delMax方法和insert方法的安全性，并修正了按容量构造的构造方法的实现^
/*
//myheap.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class myheap {
private:
	int ic;
	int inodenum;
	T* nodearr;
	bool bcreate;
	T* sortarr;
	void swap(const int nodea, const int nodeb) {
		int nodetemp = nodearr[nodea];
		nodearr[nodea] = nodearr[nodeb];
		nodearr[nodeb] = nodetemp;
	}
public:
	myheap(const int icapacity) {
		this->bcreate = false;
		this->ic = icapacity;
		this->inodenum = 0;
		this->nodearr = new T[icapacity + 1];
		this->sortarr = new T[icapacity];
		for (int i = 1; i <= this->ic; i++) {
			nodearr[i] = 0;
		}
	}
	myheap(const T tarr[], const int ihas) {
		this->bcreate = false;
		this->ic = ihas;
		this->inodenum = 0;
		this->nodearr = new T[this->ic + 1];
		this->sortarr = new T[this->ic];
		for (int i = 0; i < ihas; i++) {
			this->insert(tarr[i]);
		}
	}
	myheap(myheap& heap) {
		this->bcreate = false;
		*this = heap;
	}
	void operator=(myheap& heap) {
		if (this->bcreate) {
			this->clear();
			delete[] this->nodearr;
		}
		this->ic = heap.ic;
		this->inodenum = heap.inodenum;
		this->nodearr = new T[this->ic + 1];
		this->sortarr = new T[this->ic];
		for (int i = 0; i < this->ic; i++) {
			this->nodearr[i + 1] = heap.nodearr[i + 1];
		}
		this->bcreate = true;
	}
	T insert(const T item) {
		if (inodenum >= ic) {
			return NULL;
		}
		nodearr[++inodenum] = item;
		swim(inodenum);
		return item;
	}
	T getMax() {
		return nodearr[1];
	}
	T delMax() {
		T max = NULL;
		if (inodenum) {
			max = nodearr[1];
			nodearr[1] = nodearr[inodenum--];
			nodearr[inodenum + 1] = NULL;
			sink(1);
		}
		return max;
	}
	void clear() {
		for (int i = 0; i < ic; i++) {
			nodearr[i + 1] = NULL;
		}
		inodenum = 0;
	}
	int capacity() const {
		return ic;
	}
	int nodenum() const {
		return inodenum;
	}
	void swim(int inode) {
		if (0 < inode / 2 && nodearr[inode / 2] < nodearr[inode]) {
			swap(inode / 2, inode);
			swim(inode / 2);
		}
	}
	void sink(int inode) {
		if (inode * 2 <= inodenum && nodearr[inode * 2] >= nodearr[inode] && (inode * 2 + 1 > inodenum || nodearr[inode * 2] >= nodearr[inode * 2 + 1])) {
			swap(inode * 2, inode);
			sink(inode * 2);
		}
		else if (inode * 2 + 1 <= inodenum && nodearr[inode * 2 + 1] >= nodearr[inode] && nodearr[inode * 2] <= nodearr[inode * 2 + 1]) {
			swap(inode * 2 + 1, inode);
			sink(inode * 2 + 1);
		}
	}
	void printheap(void (*printfun)(T, bool)) {
		for (int i = 0; i < ic; i++) {
			printfun(nodearr[i + 1], i + 1 != ic);
		}
	}
	T*& heapsort() {
		myheap<T> sortheap = *this;
		int i = 0;
		while (sortheap.nodenum()) {
			this->sortarr[i++] = sortheap.delMax();
		}
		return this->sortarr;
	}
	~myheap() {
		delete[] nodearr;
		delete[] sortarr;
	}
};
//meiri.cpp
#include <iostream>
#include "myheap.hpp"
using namespace std;

void print(int* arr, int isize, int i = 0) {
	if (i < isize) {
		cout << arr[i];
		if (i < isize - 1) {
			cout << ", ";
		}
		print(arr, isize, i + 1);
	}
}

void print(int i, bool isNotEnd) {
	cout << i;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[5] = { 1, 2, 3, 4, -6 };
	myheap<int>h(arr, 5);
	h.printheap(print);
	int* sortarr = h.heapsort();
	print(sortarr, 5);
	return 0;
}
*///已新建，测试并修正了heapsort方法^
/*
//untitled7\mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QPainter>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void startgame();

    void paintEvent(QPaintEvent*);
signals:
    void Iswin();

private:
    Ui::MainWindow *ui;

    bool bmove;

    bool bwin;

    bool bwait;

    char* cp;
};
#endif // MAINWINDOW_H

//untitled7\mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QShortcut>
#include <QPropertyAnimation>
#include <QSoundEffect>
#include <QTimer>

void MainWindow::startgame(){
    ui->stackedWidget->setCurrentIndex(1);
    ui->menubar->close();
    static char strmaze[20][20] = {
        ' ',' ',' ','*',' ',' ','*',' ','*',' ',' ',' ',' ','*',' ',' ',' ',' ',' ','*',
        ' ',' ',' ',' ',' ','*',' ','*',' ',' ',' ',' ','*',' ',' ',' ',' ',' ',' ','*',
        ' ',' ',' ','*',' ','*',' ',' ',' ',' ',' ','*',' ',' ',' ','*',' ',' ','*','*',
        ' ','*','*',' ',' ',' ','*','*',' ','*',' ',' ',' ',' ','*',' ',' ',' ',' ',' ',
        ' ',' ','*',' ',' ',' ','*','*',' ','*',' ','*',' ','*',' ',' ',' ','*',' ',' ',
        ' ',' ','*',' ','*',' ',' ','*',' ',' ','*',' ','*',' ',' ',' ',' ','*',' ','*',
        ' ','*','*',' ',' ','*',' ','*',' ',' ',' ',' ',' ','*',' ',' ','*',' ',' ',' ',
        ' ',' ','*','*',' ',' ','*','*','*','*','*',' ',' ',' ','*',' ',' ',' ','*',' ',
        '*',' ','*',' ','*',' ',' ',' ',' ',' ',' ','*','*',' ',' ','*','*','*',' ',' ',
        ' ',' ','*',' ',' ','*',' ','*','*','*',' ',' ',' ',' ','*',' ',' ',' ',' ',' ',
        ' ','*','*',' ',' ',' ',' ','*',' ',' ','*','*','*',' ','*',' ',' ','*','*','*',
        ' ',' ','*',' ',' ','*',' ','*',' ','*',' ',' ','*',' ','*',' ',' ',' ','*',' ',
        '*',' ','*',' ','*',' ','*','*','*',' ',' ','*',' ',' ','*',' ',' ',' ','*',' ',
        ' ','*','*',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','*','*',' ','*',' ',
        ' ','*',' ','*','*','*',' ',' ','*',' ',' ','*',' ',' ',' ','*',' ',' ',' ',' ',
        ' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','*',' ',' ','*',' ','*',' ',' ',
        ' ',' ','*',' ','*',' ','*','*','*',' ',' ','*',' ',' ',' ','*',' ','*','*',' ',
        ' ',' ','*','*','*',' ',' ','*',' ',' ',' ',' ','*',' ',' ','*',' ','*','*','*',
        ' ',' ','*',' ','*',' ','*','*','*',' ',' ','*',' ',' ',' ','*',' ',' ','*',' ',
        ' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','*',' ',' ','*','*',' ',' ','G',
    };
    QLabel* lb = new QLabel(ui->page_2);
    QPixmap pm(48, 48);
    for (int i = 0; i <= 400; i++){
        lb = new QLabel(ui->page_2);
        if (400 == i){
            lb->move(0, 0);
            pm.load(":/Playerd.png");
        }
        else {
            lb->move(i % 20 * 48, i / 20 * 48);
            switch(strmaze[i / 20][i % 20]){
            case '*':
                pm.load(":/wall.png");
                break;
            case 'G':
                pm.load(":/Goal.png");
                break;
            default:
                pm.fill(Qt::white);
                break;
            }
        }
        pm = pm.scaled(48, 48);
        lb->setPixmap(pm);
        lb->show();
    }
    lb->show();
    QPropertyAnimation* pa = new QPropertyAnimation(lb, "geometry");
    this->bmove = true;
    this->cp = &strmaze[0][0];
    this->bwait = false;
    connect(pa, &QPropertyAnimation::finished, [=](){
        this->bwait = false;
    });
    connect(this, &MainWindow::Iswin, [=](){
        if (!this->bwin && 'G' == *this->cp){
            this->bwin = true;
            QTimer::singleShot(300, [=](){
                ui->stackedWidget->setCurrentIndex(2);
                QSoundEffect* sound = new QSoundEffect;
                sound->setSource(QUrl::fromLocalFile("C:\\Users\\Administrator\\Documents\\maze\\win.wav"));
                sound->play();
                connect(sound, &QSoundEffect::playingChanged, [=](){
                    this->close();
                });
            });
        }
    });
    const QShortcut* movesc[4] = {
        new QShortcut(QKeySequence("W"), this, [=](){
            if (!this->bwait) {
                this->bwait = true;
                QPixmap pmPlayer(":/Playerw.png");
                pmPlayer = pmPlayer.scaled(48, 48);
                lb->setPixmap(pmPlayer);
                if (this->bwait = ((cp - &strmaze[0][0]) / 20) && '*' != cp[-20]){
                    if (this->bmove){
                        lb->move(0, -484);
                        this->bmove = false;
                    }
                    this->cp -= 20;
                    pa->setEasingCurve(QEasingCurve::Linear);
                    pa->setStartValue(QRect(lb->x(), lb->y(), this->width(), this->height()));
                    pa->setEndValue(QRect(lb->x(), lb->y() - 48, this->width(), this->height()));
                    pa->start();
                }
                emit Iswin();
            }
        }),
        new QShortcut(QKeySequence("A"), this, [=](){
            if (!this->bwait) {
                this->bwait = true;
                QPixmap pmPlayer(":/Playera.png");
                pmPlayer = pmPlayer.scaled(48, 48);
                lb->setPixmap(pmPlayer);
                if (this->bwait = ((cp - &strmaze[0][0]) % 20) && '*' != cp[-1]){
                    if (this->bmove){
                        lb->move(0, -484);
                        this->bmove = false;
                    }
                    this->cp--;
                    pa->setEasingCurve(QEasingCurve::Linear);
                    pa->setStartValue(QRect(lb->x(), lb->y(), this->width(), this->height()));
                    pa->setEndValue(QRect(lb->x() - 48, lb->y(), this->width(), this->height()));
                    pa->start();
                }
                emit Iswin();
            }
        }),
        new QShortcut(QKeySequence("S"), this, [=](){
            if (!this->bwait) {
                this->bwait = true;
                QPixmap pmPlayer(":/Players.png");
                pmPlayer = pmPlayer.scaled(48, 48);
                lb->setPixmap(pmPlayer);
                if (this->bwait = 19 != ((cp - &strmaze[0][0]) / 20) && '*' != cp[20]){
                    if (this->bmove){
                        lb->move(0, -484);
                        this->bmove = false;
                    }
                    this->cp += 20;
                    pa->setEasingCurve(QEasingCurve::Linear);
                    pa->setStartValue(QRect(lb->x(), lb->y(), this->width(), this->height()));
                    pa->setEndValue(QRect(lb->x(), lb->y() + 48, this->width(), this->height()));
                    pa->start();
                }
                emit Iswin();
            }
        }),
        new QShortcut(QKeySequence("D"), this, [=](){
            if (!this->bwait) {
                this->bwait = true;
                QPixmap pmPlayer(":/Playerd.png");
                pmPlayer = pmPlayer.scaled(48, 48);
                lb->setPixmap(pmPlayer);
                if (this->bwait = 19 != ((cp - &strmaze[0][0]) % 20) && '*' != cp[1]){
                    if (this->bmove){
                        lb->move(0, -484);
                        this->bmove = false;
                    }
                    this->cp++;
                    pa->setEasingCurve(QEasingCurve::Linear);
                    pa->setStartValue(QRect(lb->x(), lb->y(), this->width(), this->height()));
                    pa->setEndValue(QRect(lb->x() + 48, lb->y(), this->width(), this->height()));
                    pa->start();
                }
                emit Iswin();
            }
        })
    };
}

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QPixmap pm(":/start.png");
    QPixmap pma(":/title.png");
    ui->label->setPixmap(pma);
    ui->toolButton->setStyleSheet("QToolButton{border:0px;}");
    ui->toolButton->setIconSize(QSize(200,200));
    ui->toolButton->setIcon(pm);
    connect(ui->toolButton, &QToolButton::clicked, [&](){
        this->startgame();
    });
    connect(ui->actionkaishi1, &QAction::triggered, [&](){
        this->startgame();
    });
    ui->actionkaishi1->setText("开始");
    ui->label_2->setPixmap(QPixmap(":/win(1).png"));
    this->bwin = false;
    this->setFixedSize(1017, 1017);
    this->setWindowIcon(QPixmap(":/icon.png"));
    this->setWindowTitle("迷宫");
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::paintEvent(QPaintEvent*){
    if (2 == ui->stackedWidget->indexOf(ui->stackedWidget->currentWidget())){
        QPainter* painter = new QPainter(this);
        painter->fillRect(this->rect(), Qt::white);
        painter->end();
    }
}
*///新迷宫游戏^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		void set() {
			this->t = NULL;
			this->left = nullptr;
			this->right = nullptr;
		}
		void set(T tf, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node;
					(*rootf)->right->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node;
					(*rootf)->left->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已创建myRedBlackTree.hpp类文件^
/*
//myRedBlacktree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		void set() {
			this->t = NULL;
			this->left = nullptr;
			this->right = nullptr;
			this->isRed = true;
		}
		void set(T tf, node* leftf = nullptr, node* rightf = nullptr, bool isRed = true) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node;
					(*rootf)->right->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node;
					(*rootf)->left->set(t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已修正myRedBlackTree红黑树node节点的set方法及set的重载方法^
/*
//mylist2.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mylist {
private:
	class node {
	public:
		T t;
		node* next;
		node(T t = NULL, node* next = nullptr) {
			this->t = t;
			this->next = next;
		}
	};
	int ic;
	node* head;
	void deletenode(node*& delnode) {
		if (nullptr != delnode->next) {
			deletenode(delnode->next);
		}
		delnode->next = nullptr;
		delete delnode;
	}
public:
	mylist() {
		this->ic = 0;
		this->head = new node;
	}
	mylist(T[] arr, int isize) {
		this->ic = 0;
		this->head = new node;
		node*& addnode = this->head;
		for (int i = 0; i < isize; i++) {
			addnode->next = new node(arr[i]);
			addnode = addnode->next;
		}
	}
	mylist(const mylist& list) {
		this->ic = 0;
		this->head = new node;
		*this = list;
	}
	mylist& operator=(const mylist& list) {
		node* searchnode = list.head;
		node*& addnode = this->head;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			addnode->next = new node(searchnode->t);
			addnode = addnode->next;
		}
	}
	~mylist() {
		deletenode(this->head);
	}
	T push_back(const T item) {
		node*& addnode = this->head;
		while (nullptr != addnode->next) {
			addnode = addnode->next;
		}
		addnode->next = new node(item);
		this->ic++;
		return item;
	}
	T insert(const T item, unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node*& addnode = this->head;
		while (index--) {
			addnode = addnode->next;
		}
		node* newnode = new node(item, addnode->next);
		addnode->next = newnode;
		this->ic++;
	}
	T del_back() {
		if (this->ic) {
			return NULL;
		}
		node*& nextIsTailNode = this->head;
		while (nullptr != nextIsTailNode->next->next) {
			nextIsTailNode = nextIsTailNode->next;
		}
		T last = nextIsTailNode->next->t;
		delete nextIsTailNode->next;
		nextIsTailNode->next = nullptr;
		this->ic--;
		return last;
	}
	T del_index(unsigned int index) {
		if (this->ic && index >= this->ic) {
			return NULL;
		}
		node*& searchnode = this->head;
		while (index--) {
			searchnode = searchnode->next;
		}
		T item = searchnode->next->t;
		node* hasnode = searchnode->next->next;
		delete searchnode->next;
		searchnode->next = hasnode;
		this->ic--;
		return item;
	}
};
*///链表新做^
/*
//mylist2.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mylist {
private:
	class node {
	public:
		T t;
		node* next;
		node(const T t = NULL, const node* next = nullptr) {
			this->t = t;
			this->next = next;
		}
	};
	int ic;
	node* head;
	void deletenode(node*& delnode) {
		if (nullptr != delnode->next) {
			deletenode(delnode->next);
		}
		delnode->next = nullptr;
		delete delnode;
	}
public:
	mylist() {
		this->ic = 0;
		this->head = new node;
	}
	mylist(T[] arr, int isize) {
		this->ic = 0;
		this->head = new node;
		node*& addnode = this->head;
		for (int i = 0; i < isize; i++) {
			addnode->next = new node(arr[i]);
			addnode = addnode->next;
		}
	}
	mylist(const mylist& list) {
		this->ic = 0;
		this->head = new node;
		*this = list;
	}
	mylist& operator=(const mylist& list) {
		node* searchnode = list.head;
		node*& addnode = this->head;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			addnode->next = new node(searchnode->t);
			addnode = addnode->next;
		}
	}
	~mylist() {
		deletenode(this->head);
	}
	T push_back(const T item) {
		node*& addnode = this->head;
		while (nullptr != addnode->next) {
			addnode = addnode->next;
		}
		addnode->next = new node(item);
		this->ic++;
		return item;
	}
	T insert(const T item, const unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node*& addnode = this->head;
		while (index--) {
			addnode = addnode->next;
		}
		node* newnode = new node(item, addnode->next);
		addnode->next = newnode;
		this->ic++;
	}
	T del_back() {
		if (this->ic) {
			return NULL;
		}
		node*& nextIsTailNode = this->head;
		while (nullptr != nextIsTailNode->next->next) {
			nextIsTailNode = nextIsTailNode->next;
		}
		T last = nextIsTailNode->next->t;
		delete nextIsTailNode->next;
		nextIsTailNode->next = nullptr;
		this->ic--;
		return last;
	}
	T del_index(const unsigned int index) {
		if (this->ic && index >= this->ic) {
			return NULL;
		}
		node*& searchnode = this->head;
		while (index--) {
			searchnode = searchnode->next;
		}
		T item = searchnode->next->t;
		node* hasnode = searchnode->next->next;
		delete searchnode->next;
		searchnode->next = hasnode;
		this->ic--;
		return item;
	}
};
*///增加某些成员方法的鲁棒性^
/*
//mylist2.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mylist {
private:
	class node {
	public:
		T t;
		node* next;
		node(const T t = NULL, node* nextTo = nullptr) {
			this->t = t;
			this->next = nextTo;
		}
	};
	unsigned int ic;
	node* head;
	void deletenode(node*& delnode) {
		if (nullptr != delnode->next) {
			deletenode(delnode->next);
		}
		delnode->next = nullptr;
		delete delnode;
	}
	T* arr;
public:
	mylist() {
		this->ic = 0;
		this->head = new node;
		this->arr = new T[0];
	}
	mylist(T* arr, const unsigned int isize) {
		this->ic = 0;
		this->head = new node;
		node*& addnode = this->head;
		this->arr = new T[0];
		for (int i = 0; i < isize; i++) {
			addnode->next = new node(arr[i]);
			addnode = addnode->next;
		}
	}
	mylist(const mylist& list) {
		this->ic = 0;
		this->head = new node;
		this->arr = new T[0];
		*this = list;
	}
	mylist& operator=(const mylist& list) {
		node* searchnode = list.head;
		node*& addnode = this->head;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			addnode->next = new node(searchnode->t);
			addnode = addnode->next;
		}
	}
	T push_back(const T item) {
		node*& addnode = this->head;
		while (nullptr != addnode->next) {
			addnode = addnode->next;
		}
		addnode->next = new node(item);
		this->ic++;
		return item;
	}
	T insert(const T item, const unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node*& addnode = this->head;
		while (index--) {
			addnode = addnode->next;
		}
		node* newnode = new node(item, addnode->next);
		addnode->next = newnode;
		this->ic++;
	}
	T del_back() {
		if (this->ic) {
			return NULL;
		}
		node*& nextIsTailNode = this->head;
		while (nullptr != nextIsTailNode->next->next) {
			nextIsTailNode = nextIsTailNode->next;
		}
		T last = nextIsTailNode->next->t;
		delete nextIsTailNode->next;
		nextIsTailNode->next = nullptr;
		this->ic--;
		return last;
	}
	T del_index(const unsigned int index) {
		if (this->ic && index >= this->ic) {
			return NULL;
		}
		node*& searchnode = this->head;
		while (index--) {
			searchnode = searchnode->next;
		}
		T item = searchnode->next->t;
		node* hasnode = searchnode->next->next;
		delete searchnode->next;
		searchnode->next = hasnode;
		this->ic--;
		return item;
	}
	void clear() {
		if (this->ic) {
			this->ic = 0;
			deletenode(this->head->next);
		}
	}
	T& operator[](const unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node* searchnode = this->head->next;
		while (index--) {
			searchnode = searchnode->next;
		}
		return searchnode->t;
	}
	T& at(const unsigned int index) {
		return *this[index];
	}
	const T* toArray() {
		delete[] this->arr;
		this->arr = new T[this->ic];
		node* searchnode = this->head;
		int i = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			this->arr[i++];
		}
		return this->arr;
	}
	long long indexOf(const T item) {
		node* searchnode = this->head;
		unsigned int index = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			if (item == searchnode->t) {
				return index;
			}
			index++;
		}
		return -1;
	}
	bool isEmpty() const {
		return 0 == this->ic;
	}
	unsigned int size() const {
		return this->ic;
	}
	~mylist() {
		deletenode(this->head);
		delete[] this->arr;
	}
};
*///clear方法已新建并实现^
/*
//mylist2.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mylist {
private:
	class node {
	public:
		T t;
		node* next;
		node(const T t = NULL, node* nextTo = nullptr) {
			this->t = t;
			this->next = nextTo;
		}
	};
	unsigned int ic;
	node* head;
	void deletenode(node*& delnode) {
		if (nullptr != delnode->next) {
			deletenode(delnode->next);
		}
		delnode->next = nullptr;
		delete delnode;
	}
	T* arr;
public:
	mylist() {
		this->ic = 0;
		this->head = new node;
		this->arr = new T[0];
	}
	mylist(T* arr, const unsigned int isize) {
		this->ic = 0;
		this->head = new node;
		node*& addnode = this->head;
		this->arr = new T[0];
		for (int i = 0; i < isize; i++) {
			addnode->next = new node(arr[i]);
			addnode = addnode->next;
		}
	}
	mylist(const mylist& list) {
		this->ic = 0;
		this->head = new node;
		this->arr = new T[0];
		*this = list;
	}
	mylist& operator=(const mylist& list) {
		node* searchnode = list.head;
		node*& addnode = this->head;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			addnode->next = new node(searchnode->t);
			addnode = addnode->next;
		}
		return *this;
	}
	T push_back(const T item) {
		node*& addnode = this->head;
		while (nullptr != addnode->next) {
			addnode = addnode->next;
		}
		addnode->next = new node(item);
		this->ic++;
		return item;
	}
	T insert(const T item, unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node*& addnode = this->head;
		while (index--) {
			addnode = addnode->next;
		}
		node* newnode = new node(item, addnode->next);
		addnode->next = newnode;
		this->ic++;
	}
	T del_back() {
		if (!this->ic) {
			return NULL;
		}
		node*& nextIsTailNode = this->head;
		while (nullptr != nextIsTailNode->next->next) {
			nextIsTailNode = nextIsTailNode->next;
		}
		T last = nextIsTailNode->next->t;
		delete nextIsTailNode->next;
		nextIsTailNode->next = nullptr;
		this->ic--;
		return last;
	}
	T del_index(unsigned int index) {
		if (!this->ic || index >= this->ic) {
			return NULL;
		}
		node*& searchnode = this->head;
		while (index--) {
			searchnode = searchnode->next;
		}
		T item = searchnode->next->t;
		node* hasnode = searchnode->next->next;
		delete searchnode->next;
		searchnode->next = hasnode;
		this->ic--;
		return item;
	}
	void clear() {
		if (this->ic) {
			this->ic = 0;
			deletenode(this->head->next);
		}
	}
	T& operator[](unsigned int index) {
		if (index >= this->ic) {
			static T nulldata = NULL;
			return nulldata;
		}
		node* searchnode = this->head->next;
		while (index--) {
			searchnode = searchnode->next;
		}
		return searchnode->t;
	}
	T& at(const unsigned int index) {
		return (*this)[index];
	}
	const T* toArray() {
		delete[] this->arr;
		this->arr = new T[this->ic];
		node* searchnode = this->head;
		int i = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			this->arr[i++];
		}
		return this->arr;
	}
	long long indexOf(const T item) {
		node* searchnode = this->head;
		unsigned int index = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			if (item == searchnode->t) {
				return index;
			}
			index++;
		}
		return -1;
	}
	bool isEmpty() const {
		return 0 == this->ic;
	}
	unsigned int size() const {
		return this->ic;
	}
	~mylist() {
		deletenode(this->head);
		delete[] this->arr;
	}
};
*///一些bug已修复^
/*
//meiri.cpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class mylist {
private:
	class node {
	public:
		T t;
		node* next;
		node(const T t = NULL, node* nextTo = nullptr) {
			this->t = t;
			this->next = nextTo;
		}
	};
	unsigned int ic;
	node* head;
	void deletenode(node*& delnode) {
		if (nullptr != delnode->next) {
			deletenode(delnode->next);
		}
		delnode->next = nullptr;
		delete delnode;
	}
	T* arr;
public:
	mylist() {
		this->ic = 0;
		this->head = new node;
		this->arr = new T[0];
	}
	mylist(T* array, const unsigned int isize) {
		this->ic = isize;
		this->head = new node;
		node** addnode = &this->head;
		this->arr = new T[0];
		for (int i = 0; i < isize; i++) {
			(*addnode)->next = new node(array[i]);
			addnode = &(*addnode)->next;
		}
	}
	mylist(const mylist& list) {
		this->ic = list.ic;
		this->head = new node;
		this->arr = new T[0];
		*this = list;
	}
	mylist& operator=(const mylist& list) {
		node* searchnode = list.head;
		node** addnode = &this->head;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			(*addnode)->next = new node(searchnode->t);
			addnode = &(*addnode)->next;
		}
		return *this;
	}
	~mylist() {
		deletenode(this->head);
		delete[] this->arr;
	}
	T push_back(const T item) {
		node** addnode = &this->head;
		while (nullptr != (*addnode)->next) {
			addnode = &(*addnode)->next;
		}
		(*addnode)->next = new node(item);
		this->ic++;
		return item;
	}
	T insert(const T item, unsigned int index) {
		if (index >= this->ic) {
			return NULL;
		}
		node** addnode = &this->head;
		while (index--) {
			addnode = &(*addnode)->next;
		}
		node* newnode = new node(item, (*addnode)->next);
		(*addnode)->next = newnode;
		this->ic++;
	}
	T del_back() {
		if (!this->ic) {
			return NULL;
		}
		node** nextIsTailNode = &this->head;
		while (nullptr != (*nextIsTailNode)->next->next) {
			nextIsTailNode = &(*nextIsTailNode)->next;
		}
		T last = (*nextIsTailNode)->next->t;
		delete (*nextIsTailNode)->next;
		(*nextIsTailNode)->next = nullptr;
		this->ic--;
		return last;
	}
	T del_index(unsigned int index) {
		if (!this->ic || index >= this->ic) {
			return NULL;
		}
		node** searchnode = &this->head;
		while (index--) {
			searchnode = &(*searchnode)->next;
		}
		T item = (*searchnode)->next->t;
		node* hasnode = (*searchnode)->next->next;
		delete (*searchnode)->next;
		(*searchnode)->next = hasnode;
		this->ic--;
		return item;
	}
	void clear() {
		if (this->ic) {
			this->ic = 0;
			deletenode(this->head->next);
			this->head->next = nullptr;
		}
	}
	T& operator[](unsigned int index) {
		if (index >= this->ic) {
			static T nulldata = NULL;
			return nulldata;
		}
		node* searchnode = this->head->next;
		while (index--) {
			searchnode = searchnode->next;
		}
		return searchnode->t;
	}
	T& at(const unsigned int index) {
		return (*this)[index];
	}
	T*& toArray() {
 		delete[] this->arr;
		this->arr = new T[this->ic];
		node* searchnode = this->head;
		int i = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			this->arr[i++] = searchnode->t;
		}
		return this->arr;
	}
	long long indexOf(const T item) {
		node* searchnode = this->head;
		unsigned int index = 0;
		while (nullptr != searchnode->next) {
			searchnode = searchnode->next;
			if (item == searchnode->t) {
				return index;
			}
			index++;
		}
		return -1;
	}
	bool isEmpty() const {
		return 0 == this->ic;
	}
	unsigned int size() const {
		return this->ic;
	}
};
*///新链表完成后的链表类^
/*
//meiri.cpp
#include <iostream>
#include "mylist2.hpp"
using namespace std;

int main() {
	mylist<int>m;
	cout << "原始大小：" << m.size() << "    是否为空：" << (m.isEmpty() ? "true" : "false") << endl;
	m.insert(1, 0);
	m.push_back(1);
	m.push_back(2);
	m.insert(3, 1);
	cout << "链表m增加数据后大小：" << m.size() << "    是否为空：" << (m.isEmpty() ? "true" : "false") << endl;
	m.del_back();
	m.del_index(2);
	m.del_index(1);
	cout << "链表m删除数据后大小：" << m.size() << "    是否为空：" << (m.isEmpty() ? "true" : "false") << endl;
	int arr[5] = { 1, 2, 3, 4, 5 };
	mylist<int>ma(arr, 5);
	mylist<int>mb = ma;
	const int* arra = ma.toArray();
	const int* arrb = mb.toArray();
	int i = 0;
	while (i < 5) {
		cout << "ma[" << i << "] == mb[" << i << "]：" << (arra[i] == arrb[i] ? "true" : "false") << endl;
		i++;
	}
	cout << "ma[1] = " << ma[1] << "    ma[3] == ma.at(3)：" << (ma[3] == ma.at(3) ? "true" : "false") << endl;
	cout << "5 == ma[ma.indexOf(5)]：" << (5 == ma[ma.indexOf(5)] ? "true" : "false") << endl;
	cout << "ma.indexOf(7) = " << ma.indexOf(7) << "    NULL == ma[-1]：" << (NULL == ma[-1] ? "true" : "false") << endl;
	m.clear();
	cout << "链表m清空数据后大小：" << m.size() << "    是否为空：" << (m.isEmpty() ? "true" : "false") << endl;
	return 0;
}
*///新链表完成之后用于测试的测试代码^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	void leftTurn(node** turnnode) {

	}
	void rightTurn(node** turnnode) {

	}
	void filpColours(node** filpnode) {

	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建leftTurn方法，rightTurn方法，filpColours方法和节点类的构造方法，并删除了原有的set方法，修正了insert方法的实现^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	void leftTurn(node** turnnode) {
		//node* midnode = (*turnnode)->right->left;
		//node* rightnode = (*turnnode)->right;
		//(*turnnode)->right = midnode;
		//(*turnnode)->isRed = true;

	}
	void rightTurn(node** turnnode) {

	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已实现filpcolours方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	void leftTurn(node** turnnode) {
		T tempitem = turnnode->t;
		turnnode->t = turnnode->right->t;
		turnnode->right->t = tempitem;
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		node* tempnode = turnnode->left->left;
		turnnode->left->left = turnnode->left->right;
		turnnode->left->right = tempnode;
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {

	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///红黑树myRedBlackTree的leftTurn方法已实现^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->right->t);
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		this->swap(turnnode->left->left, turnnode->left->right);
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {

	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {

	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建并实现swap私有方法，并简化了leftTurn方法的实现^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->right->t);
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		this->swap(turnnode->left->left, turnnode->left->right);
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->left->t);
		node* minnode = turnnode->left->left;
		turnnode->right = turnnode->left;
		delete turnnode->left;
		this->swap(turnnode->right->left, turnnode->right->right);
		turnnode->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已实现红黑树myRedBlackTree的clear方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->right->t);
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		this->swap(turnnode->left->left, turnnode->left->right);
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->left->t);
		node* minnode = turnnode->left->left;
		turnnode->right = turnnode->left;
		delete turnnode->left;
		this->swap(turnnode->right->left, turnnode->right->right);
		turnnode->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void getLRnode(node* node) {

	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建myRedBlackTree的getLRnode方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	int iprints;
	void insert(T t, node** rootf) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->right->t);
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		this->swap(turnnode->left->left, turnnode->left->right);
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->left->t);
		node* minnode = turnnode->left->left;
		turnnode->right = turnnode->left;
		delete turnnode->left;
		this->swap(turnnode->right->left, turnnode->right->right);
		turnnode->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			this->getLRnode(node->left);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			this->getLRnode(node->right);
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已把方法getLRnode的名改为printLRnode，并实现myRedBlackTree的printtree方法和printLRnode方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	int iprints;
	void change(node* n) {
		
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;

				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->right->t);
		node* maxnode = turnnode->right->right;
		turnnode->left = turnnode->right;
		delete turnnode->right;
		this->swap(turnnode->left->left, turnnode->left->right);
		turnnode->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap(turnnode->t, turnnode->left->t);
		node* minnode = turnnode->left->left;
		turnnode->right = turnnode->left;
		delete turnnode->left;
		this->swap(turnnode->right->left, turnnode->right->right);
		turnnode->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			this->getLRnode(node->left);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			this->getLRnode(node->right);
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建change方法，并修改了insert重载方法的参数^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	int iprints;
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
					leftTurn(rootf);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
					if ((*beforenode)->left->isRed){
						rightTurn(rootf)
					}
					filpColours(rootf);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		delete (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		(*turnnode)->right = (*turnnode)->left;
		delete (*turnnode)->left;
		delete (*turnnode)->right->left;
		(*turnnode)->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			this->getLRnode(node->left);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			this->getLRnode(node->right);
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		root->set();
		this->ic = 0;
		this->nodenf = 0;
		this->returnnode = nullptr;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void operator=(myRedBlackTree& ml) {
		queue<node*>q;
		node* addnode = nullptr;
		q.push(ml.root);
		while (q.size()) {
			addnode = q.front();
			if (nullptr != addnode->left) {
				q.push(addnode->left);
			}
			if (nullptr != addnode->right) {
				q.push(addnode->right);
			}
			this->insert(q.front()->t);
			q.pop();
		}
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已删除change方法，并完全实现了insert重载方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int nodenf;
	int iprints;
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
					leftTurn(rootf);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
					if ((*beforenode)->left->isRed){
						rightTurn(rootf);
					}
					filpColours(rootf);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		delete (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		(*turnnode)->right = (*turnnode)->left;
		delete (*turnnode)->left;
		delete (*turnnode)->right->left;
		(*turnnode)->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		this->ic = 0;
		this->nodenf = 0;
	}
	myRedBlackTree(T* arr, int ihas) {

	}
	myRedBlackTree(myRedBlackTree& tree) {

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///第一次修改之后的红黑树类实现^
/*
//meiri.cpp
#include <iostream>
#include "myRedbLackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	myRedBlackTree<int>m;
	for (int i = 0; i < 10; i++) {
		m.insert(i);
	}
	m.printtree(print);
	return 0;
}
*///第一次测试的代码^
/*
//myRedBalckTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(T tf = NULL, bool isRed = true, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(t, true);
					ic++;
					leftTurn(rootf);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(t, true);
					ic++;
					if ((*beforenode)->left->isRed){
						rightTurn(rootf);
					}
					filpColours(rootf);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		delete (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		(*turnnode)->right = (*turnnode)->left;
		delete (*turnnode)->left;
		delete (*turnnode)->right->left;
		(*turnnode)->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node;
		this->ic = 0;
	}
	myRedBlackTree(T* arr, int ihas) {

	}
	myRedBlackTree(myRedBlackTree& tree) {

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///多余成员变量已删除^
/*
//myRedBalckTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					leftTurn(rootf);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					if (nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed){
						rightTurn(rootf);
					}
					filpColours(rootf);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		delete (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		(*turnnode)->right = (*turnnode)->left;
		delete (*turnnode)->left;
		delete (*turnnode)->right->left;
		(*turnnode)->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已修改红黑树部分方法实现^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					leftTurn(rootf);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					if (nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed){
						rightTurn(rootf);
					}
					filpColours(rootf);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		(*turnnode)->right = (*turnnode)->left;
		delete (*turnnode)->left;
		delete (*turnnode)->right->left;
		(*turnnode)->left = minnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已修正红黑树leftTurn方法^
/*
//ui\widget.cpp
#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button = new QPushButton;
    ui->toolBox->addItem(button, "ggg");
}

Widget::~Widget()
{
    delete ui;
}
*///toolBox增加页的操作^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if ((*nodea)->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(nodea);
			filpColours(nodea);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建并实现check方法，且修正好私有重载的insert方法^
/*
//meiri.cpp
#include <iostream>
#include "myRedbLackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	myRedBlackTree<int>m;
	for (int i = 10; i > 1; i--) {
		m.insert(i);
	}
	m.printtree(print);
	return 0;
}
*///已更换新的测试代码^
/*
//meiri.cpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != (*nodea)->right && (*nodea)->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
			filpColours(beforenode);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = false;
		}
		(*filpnode)->left->isRed = true;
		(*filpnode)->right->isRed = true;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已修正红黑树的check方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已修正红黑树的filpColour方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					//check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///红黑树的insert重载方法已再次修正^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
					
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
					//check(rootf, beforenode);
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;

	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///红黑树的数组构造方法已实现完成^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		node** addnode = &this->root;
		node* searchnode = tree.root;


	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///红黑树的拷贝函数的基础已搭建好^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(nodea);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void copy(node** addnode, node* searchnode) {
		if (nullptr != searchnode) {
			(*addnode)->t = searchnode->t;
			(*addnode)->isRed = searchnode->isRed;
			copy(&(*addnode)->left, searchnode->left);
			copy(&(*addnode)->right, searchnode->right);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false);
		this->ic = tree.ic;
		this->iprints = 0;
		node** addnode = &this->root;
		node* searchnode = tree.root;
		this->copy(&this->root, tree.root);
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已新建并实现好红黑树的copy临时方法，且实现了红黑树的拷贝方法^
/*
//meiri.cpp
#include <iostream>
#include "myRedbLackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	myRedBlackTree<int>m(arr, 10);
	cout << "max = " << m.max() << " min = " << m.min() << endl;
	return 0;
}
*///已测试红黑树的max和min方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void copy(node** addnode, node* searchnode) {
		if (nullptr != searchnode) {
			if (this->root != *addnode) {
				*addnode = new node(searchnode->isRed, searchnode->t);
			}
			copy(&(*addnode)->left, searchnode->left);
			copy(&(*addnode)->right, searchnode->right);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
//meiri.cpp
#include <iostream>
#include "myRedbLackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	myRedBlackTree<int>mt(arr, 10);
	myRedBlackTree<int>m = mt;
	m.printtree(print);
	return 0;
}
*///已测试并修正红黑树的拷贝构造方法和临时的copy方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void copy(node** addnode, node* searchnode) {
		if (nullptr != searchnode) {
			if (this->root != *addnode) {
				*addnode = new node(searchnode->isRed, searchnode->t);
			}
			copy(&(*addnode)->left, searchnode->left);
			copy(&(*addnode)->right, searchnode->right);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 != this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
	}
	myRedBlackTree& operator=(myRedBlackTree& tree){
		delete root;
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
		return *this;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
//meiri.cpp
#include <iostream>
#include "myRedBlackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	myRedBlackTree<int>mt(arr, 10);
	myRedBlackTree<int>m = mt;
	myRedBlackTree<int>ma;
	ma = m;
	ma.printtree(print);
	return 0;
}
*///已新建并实现红黑树的重载赋值运算符^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
#include <queue>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void copy(node** addnode, node* searchnode) {
		if (nullptr != searchnode) {
			if (this->root != *addnode) {
				*addnode = new node(searchnode->isRed, searchnode->t);
			}
			copy(&(*addnode)->left, searchnode->left);
			copy(&(*addnode)->right, searchnode->right);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 < this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
	}
	myRedBlackTree& operator=(myRedBlackTree& tree){
		delete root;
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
		return *this;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
//meiri.cpp
#include <iostream>
#include "myRedBlackTree.hpp"
using namespace std;

void print(int item, bool isNotEnd) {
	cout << item;
	if (isNotEnd) {
		cout << ", ";
	}
	else {
		cout << endl;
	}
}

int main() {
	int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	myRedBlackTree<int>m(arr, 10);
	cout << "clear前：" << m.capacity() << "  " << m.IsEmpty() << endl;
	m.clear();
	cout << "clear后：" << m.capacity() << "  " << m.IsEmpty() << endl;
	m.printtree(print);
	return 0;
}
*///已修正红黑树的printtree方法，并测试了红黑树的capacity方法，IsEmpty方法和clear方法^
/*
//myRedBlackTree.hpp
#pragma once
#include <iostream>
using namespace std;
template<class T>
class myRedBlackTree {
private:
	int ic;
	class node {
	public:
		T t;
		node* left;
		node* right;
		bool isRed;
		node(bool isRed = true, T tf = NULL, node* leftf = nullptr, node* rightf = nullptr) {
			this->t = tf;
			this->left = leftf;
			this->right = rightf;
			this->isRed = isRed;
		}
	};
	node* root;
	int iprints;
	void check(node** nodea, node** beforenode) {
		if (nullptr != beforenode && nullptr != (*beforenode)->right && nullptr != (*beforenode)->right->right && (*beforenode)->right->isRed && (*beforenode)->right->right->isRed) {
			leftTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->left->left && (*beforenode)->left->isRed && (*beforenode)->left->left->isRed) {
			rightTurn(beforenode);
		}
		if (nullptr != beforenode && nullptr != (*beforenode)->left && nullptr != (*beforenode)->right && (*beforenode)->left->isRed && (*beforenode)->right->isRed) {
			filpColours(beforenode);
		}
	}
	void copy(node** addnode, node* searchnode) {
		if (nullptr != searchnode) {
			if (this->root != *addnode) {
				*addnode = new node(searchnode->isRed, searchnode->t);
			}
			copy(&(*addnode)->left, searchnode->left);
			copy(&(*addnode)->right, searchnode->right);
		}
	}
	void insert(T t, node** rootf, node** beforenode = nullptr) {
		if (!ic) {
			root->t = t;
			ic++;
			return;
		}
		else {
			if (t > (*rootf)->t) {
				if (nullptr == (*rootf)->right) {
					(*rootf)->right = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->right, rootf);
				}
			}
			else {
				if (nullptr == (*rootf)->left) {
					(*rootf)->left = new node(true, t);
					ic++;
				}
				else {
					insert(t, &(*rootf)->left, rootf);
				}
			}
		}
		check(rootf, beforenode);
	}
	template<typename Ta>
	void swap(Ta& itema, Ta& itemb) {
		Ta temp = itema;
		itema = itemb;
		itemb = temp;
	}
	void leftTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->right->t);
		node* minnode = (*turnnode)->left;
		node* maxnode = (*turnnode)->right->right;
		(*turnnode)->left = (*turnnode)->right;
		this->swap((*turnnode)->left->left, (*turnnode)->left->right);
		(*turnnode)->right = maxnode;
		(*turnnode)->left->left = minnode;
	}
	void rightTurn(node** turnnode) {
		this->swap((*turnnode)->t, (*turnnode)->left->t);
		node* minnode = (*turnnode)->left->left;
		node* maxnode = (*turnnode)->right;
		(*turnnode)->right = (*turnnode)->left;
		this->swap((*turnnode)->right->left, (*turnnode)->right->right);
		(*turnnode)->left = minnode;
		(*turnnode)->right->right = maxnode;
	}
	void filpColours(node** filpnode) {
		if (this->root != *filpnode) {
			(*filpnode)->isRed = true;
		}
		(*filpnode)->left->isRed = false;
		(*filpnode)->right->isRed = false;
	}
	void printLRnode(node* node, void (*printfun)(T item, bool b)) {
		if (nullptr != node) {
			printLRnode(node->left, printfun);
			printfun(node->t, this->iprints + 1 < this->ic);
			this->iprints++;
			printLRnode(node->right, printfun);
		}
	}
public:
	myRedBlackTree() {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
	}
	myRedBlackTree(T* arr, int ihas) {
		root = new node(false);
		this->ic = 0;
		this->iprints = 0;
		for (int i = 0; i < ihas; i++) {
			this->insert(arr[i]);
		}
	}
	myRedBlackTree(myRedBlackTree& tree) {
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
	}
	myRedBlackTree& operator=(myRedBlackTree& tree){
		delete root;
		root = new node(false, tree.root->t);
		this->ic = tree.ic;
		this->iprints = 0;
		this->copy(&this->root, tree.root);
		return *this;
	}
	void insert(T t) {
		insert(t, &root);
	}
	int capacity() const {
		return ic;
	}
	void clear() {
		if (nullptr != root->left) {
			delete root->left;
			root->left = nullptr;
		}
		if (nullptr != root->right) {
			delete root->right;
			root->right = nullptr;
		}
		root->t = NULL;
		this->ic = 0;
	}
	~myRedBlackTree() {
		clear();
		delete root;
	}
	bool IsEmpty() const {
		return !ic;
	}
	void printtree(void (*printfun)(T item, bool b)) {
		this->iprints = 0;
		printLRnode(root, printfun);
	}
	T max() {
		node** findnode = &root;
		while (nullptr != (*findnode)->right) {
			findnode = &(*findnode)->right;
		}
		return (*findnode)->t;
	}
	T min() {
		node** findnode = &root;
		while (nullptr != (*findnode)->left) {
			findnode = &(*findnode)->left;
		}
		return (*findnode)->t;
	}
};
*///已不在红黑树类里边导入queue类文件^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			this->sequencArr.push_back(v);
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
	}
	bool searchNodeFrom(const unsigned int index) {
		if (index < this->ic) {
			return this->nodeArr[index]->from;
		}
		else {
			return false;
		}
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
};
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
using namespace std;

int main() {
	vector<int>v = { 1, 2, 3, 4 };
	oneGroupUF<int>o = v;
	vector<vector<int>>vv = o.generateAllSequences();
	for (vector<int>tempv : vv) {
		for (int i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
	return 0;
}
*///已基本完成单组并查集OneGroupUF类^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
	}
	bool searchNodeFrom(const unsigned int index) {
		if (index < this->ic) {
			return this->nodeArr[index]->from;
		}
		else {
			return false;
		}
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
};
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
#include <climits>
using namespace std;

void print(oneGroupUF<int>& o) {
	vector<vector<int>>vv = o.generateAllSequences();
	for (vector<int>tempv : vv) {
		for (int i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
}

int main() {
	oneGroupUF<int>o;
	for (int i = 0; i < 4; i++) {
		o.push_back(i);
	}
	print(o);
	cout << o.countSequences() << endl;
	cout << "-----------" << endl;
	o.clear();
	print(o);
	cout << o.countSequences() << endl;
	return 0;
}
*///已修正单组并查集oneGroupUF的generateAllSequences私有重载方法，并测试了单组并查集oneGroupUF的push_back方法，clear方法^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
	}
	bool searchNodeFrom(const unsigned int index) {
		if (index < this->ic) {
			return this->nodeArr[index]->from;
		}
		else {
			return false;
		}
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
#include <climits>
using namespace std;

template<typename T>
void print(oneGroupUF<T>& o) {
	vector<vector<T>>vv = o.generateAllSequences();
	for (vector<T>tempv : vv) {
		for (T i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
}

int main() {
	oneGroupUF<char>o;
	for (char ch = 'a'; ch <= 'z'; ch++) {
		o.push_back(ch);
	}
	o.push_back('.');
	cout << o.getCapacity() << endl;
	o.pop_back();
	cout << o.getCapacity() << endl;
	print(o);
	return 0;
}
*///已新建并测试了oneGroupUF单组并查集的getCapacity方法和pop_back方法^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
*///已删除单组并查集oneGroupUF的searchNodeFrom方法^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
using namespace std;

template<typename T>
void print(oneGroupUF<T>& o) {
	vector<vector<T>>vv = o.generateAllSequences();
	for (vector<T>tempv : vv) {
		for (T i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
}

int main() {
	oneGroupUF<char>o;
	for (char ch = 'a'; ch <= 'd'; ch++) {
		o.push_back(ch);
	}
	for (int i = 0; i < 4; i++) {
		cout << o[i];
		if (3 == i) {
			cout << endl;
		}
		else {
			cout << ", ";
		}
	}
	
	return 0;
}
*///已测试oneGroupUF单组并查集的at方法和重载的中括号运算符^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
		this->sequencArr = uf.sequencArr;
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
*///已修正oneGroupUF单组并查集的拷贝构造方法^
/*
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
using namespace std;

template<typename T>
void print(oneGroupUF<T>& o) {
	vector<vector<T>>vv = o.generateAllSequences();
	for (vector<T>tempv : vv) {
		for (T i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
}

int main() {
	oneGroupUF<char>o;
	for (char ch = 'a'; ch <= 'd'; ch++) {
		o.push_back(ch);
	}
	o.generateAllSequences();
	oneGroupUF<char>oa = o;
	print(oa);
	cout << oa.countSequences() << endl;
	return 0;
}
*///已测试oneGroupUF单组并查集的拷贝构造方法^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
		this->sequencArr = uf.sequencArr;
	}
	oneGroupUF& operator=(oneGroupUF& uf) {
		this->clear();
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
		this->sequencArr = uf.sequencArr;
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
*///已新建并实现重载赋值运算符^
/*
//1GUF.hpp
#pragma once
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
template<class T>
class oneGroupUF {
private:
	class node {
	public:
		T item;
		bool from;
		node(T t = NULL, bool f = false) {
			this->item = t;
			this->from = f;
		}
	};
	vector<node*> nodeArr;
	int ic;
	vector<vector<T>>sequencArr;
	void swap_node(const unsigned int index, const unsigned int indexa) {
		node* temp = this->nodeArr[index];
		this->nodeArr[index] = this->nodeArr[indexa];
		this->nodeArr[indexa] = temp;
	}
	void generateAllSequences(const unsigned int insert_index) {
		if (this->ic <= insert_index && this->ic) {
			vector<T>v;
			for (node* n : this->nodeArr) {
				v.push_back(n->item);
			}
			if (this->sequencArr.end() == find(this->sequencArr.begin(), this->sequencArr.end(), v)) {
				this->sequencArr.push_back(v);
			}
			return;
		}
		for (int i = 0; i < this->ic; i++) {
			if (!this->nodeArr[i]->from) {
				this->nodeArr[i]->from = true;
				swap_node(insert_index, i);
				generateAllSequences(insert_index + 1);
				swap_node(insert_index, i);
				this->nodeArr[i]->from = false;
			}
		}
	}
public:
	oneGroupUF() {
		this->ic = 0;
	}
	oneGroupUF(const unsigned int isize) {
		this->nodeArr.reserve(isize);
		this->ic = isize;
	}
	oneGroupUF(vector<T>v) {
		for (T item : v) {
			this->nodeArr.push_back(new node(item));
		}
		this->ic = v.size();
	}
	oneGroupUF(oneGroupUF& uf) {
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
		this->sequencArr = uf.sequencArr;
	}
	oneGroupUF& operator=(oneGroupUF& uf) {
		this->clear();
		for (node* n : uf.nodeArr) {
			this->push_back(n->item);
		}
		this->sequencArr = uf.sequencArr;
		return *this;
	}
	T& at(const unsigned int index) {
		assert(index < this->ic);
		return this->nodeArr[index]->item;
	}
	T& operator[](const unsigned int index) {
		return at(index);
	}
	T push_back(const T t) {
		this->nodeArr.push_back(new node(t));
		this->ic++;
		return t;
	}
	T pop_back() {
		if (!this->ic) {
			return NULL;
		}
		T last = this->nodeArr.back()->item;
		delete this->nodeArr.back();
		this->nodeArr.pop_back();
		this->ic--;
		return last;
	}
	void clear() {
		while (this->ic) {
			pop_back();
		}
	}
	vector<vector<T>> generateAllSequences() {
		this->sequencArr.clear();
		generateAllSequences(0);
		return this->sequencArr;
	}
	~oneGroupUF() {
		clear();
	}
	unsigned int countSequences() {
		return this->sequencArr.size();
	}
	unsigned int getCapacity() {
		return this->ic;
	}
};
//meiri.cpp
#include <iostream>
#include "1GUF.hpp"
using namespace std;

template<typename T>
void print(oneGroupUF<T>& o) {
	vector<vector<T>>vv = o.generateAllSequences();
	for (vector<T>tempv : vv) {
		for (T i : tempv) {
			cout << i << " ";
		}
		cout << endl;
	}
}

int main() {
	oneGroupUF<char>o;
	vector<char>v = {'s', 't', 'a', 't', 'i', 'c', 'E', 'r', 'r', 'o', 'r'};
	for (char ch = 'a'; ch <= 'd'; ch++) {
		o.push_back(ch);
	}
	o.generateAllSequences();
	oneGroupUF<char>oa = v;
	oa = o;
	print(oa);
	cout << oa.countSequences() << endl;
	return 0;
}
*///已测试并修正oneGroupUF单组并查集的重载赋值运算符^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = num.end() - 1;
		while (num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		if (numLen) {
			this->len = numLen;
			this->num.reserve(numLen);
		}
		else {
			unsigned int tim = 1;
			unsigned int i = 1;
			while (tim >= n) {
				tim *= ++i;
			}
			this->len = i;
			this->num.reserve(i);
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator++(int) {
		return;
	}
	unsignedHierarchicalNum& operator--(int) {
		return;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		return;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		return;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) {
		if (position >= num.size()) {
			return NULL;
		}
		else {
			return num[position];
		}
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = this->num.end() - 1;
		while (this->num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
};
*///已新建unsignedHierarchicalNum阶进制数的所有所需方法，并实现unsignedHierarchicalNum阶进制数类的一些主要方法^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = num.end() - 1;
		while (num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		if (numLen) {
			this->len = numLen;
			this->num.reserve(numLen);
		}
		else {
			unsigned int tim = 1;
			unsigned int i = 1;
			while (tim >= n) {
				tim *= ++i;
			}
			this->len = i;
			this->num.reserve(i);
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum operator++(int) {
		unsignedHierarchicalNum num = *this;
		add(1, this->num);
		return num;
	}
	unsignedHierarchicalNum operator--(int) {
		unsignedHierarchicalNum num = *this;
		sub(1, this->num);
		return num;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		add(addNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		sub(subNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) {
		if (position >= num.size()) {
			return NULL;
		}
		else {
			return num[position];
		}
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = this->num.end() - 1;
		while (this->num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
};
*///已实现阶进制类unsignedHierarchicalNum的所有所需方法^
/*
//meiri.cpp
#include<iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    cout << u_n.toUnsignedInt();
    return 0;
}
*///已测试阶进制数类unsignedHierarchicalNum的有参构造方法和toUnsignedInt方法^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = num.end() - 1;
		while (num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		auto it = n.end() - 1;
		unsigned int levelUp = 2;
		while (it <= n.begin()) {
			*it = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it--;
			*it = upNum;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		if (numLen) {
			this->len = numLen;
			this->num.reserve(numLen);
		}
		else {
			unsigned int tim = 1;
			unsigned int i = 1;
			while (tim < n) {
				tim *= ++i;
			}
			this->len = i;
			for (; i; i--) {
				this->num.push_back(0);
			}
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum operator++(int) {
		unsignedHierarchicalNum num = *this;
		add(1, this->num);
		return num;
	}
	unsignedHierarchicalNum operator--(int) {
		unsignedHierarchicalNum num = *this;
		sub(1, this->num);
		return num;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		add(addNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		sub(subNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) {
		if (position >= num.size()) {
			return NULL;
		}
		else {
			return num[position];
		}
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		auto it = this->num.end() - 1;
		while (this->num.begin() <= it) {
			u_i += *it * digitNum;
			digitNum *= digitNum + 1;
			it--;
		}
		return u_i;
	}
};
*///已尝试修正unsignedHierarchicalNum阶进制数类的构造方法^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = num.size() - 1;
		while (0 <= it) {
			u_i += num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		unsigned int tim = 1;
		unsigned int i = 1;
		while (!numLen && tim < n) {
			tim *= ++i;
		}
		this->len = i;
		for (; i; i--) {
			this->num.push_back(0);
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum operator++(int) {
		unsignedHierarchicalNum num = *this;
		add(1, this->num);
		return num;
	}
	unsignedHierarchicalNum operator--(int) {
		unsignedHierarchicalNum num = *this;
		sub(1, this->num);
		return num;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		add(addNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		sub(subNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) const {
		return position >= num.size() ? NULL : num[position];
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = this->num.size() - 1;
		while (0 <= it) {
			u_i += this->num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
};
*///已修正好阶进制数unsignedHierarchicalNum的一些方法^
/*
//meiri.cpp
#include<iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    cout << (u_n - 10).toUnsignedInt();
    return 0;
}
*///已为阶进制数unsignedHierarchicalNum更换新的测试代码并测试^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = num.size() - 1;
		while (0 <= it) {
			u_i += num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		unsigned int tim = 1;
		unsigned int i = 1;
		while (!numLen && tim < n) {
			tim *= ++i;
		}
		this->len = i;
		for (; i; i--) {
			this->num.push_back(0);
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum operator++(int) {
		unsignedHierarchicalNum num = *this;
		add(1, this->num);
		return num;
	}
	unsignedHierarchicalNum operator--(int) {
		unsignedHierarchicalNum num = *this;
		sub(1, this->num);
		return num;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		add(addNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		sub(subNum, this->num);
		return *this;
	}
	unsigned int operator=(unsigned int n) {
		unsigned int upNum = n;
		int it = this->num.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			this->num[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? this->num[it] = upNum : 0;
		}
		return n;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) const {
		return position >= num.size() ? NULL : num[position];
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = this->num.size() - 1;
		while (0 <= it) {
			u_i += this->num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
};
//meiri.cpp
#include<iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    u_n = 10;
    cout << u_n.toUnsignedInt();
    return 0;
}
*///已新建并测试了阶进制数类unsignedHierarchicalNum的返回无符号整数的重载赋值运算符^
/*
//meiri.cpp
#include<iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    u_n += 10;
    cout << u_n.toUnsignedInt();
    return 0;
}
*///已测试阶进制数类unsignedHierarchicalNum的加等号运算符^
/*
//meiri.cpp
#include <iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    u_n -= 10;
    cout << u_n.toUnsignedInt();
    return 0;
}
*///已测试阶进制数类unsignedHierarchicalNum的减等号运算符^
/*
//meiri.cpp
#include <iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100);
    cout << u_n++.toUnsignedInt() << endl;
    cout << (++u_n).toUnsignedInt() << endl;
    cout << u_n--.toUnsignedInt() << endl;
    cout << (--u_n).toUnsignedInt() << endl;
    return 0;
}
*///已测试阶进制数类unsignedHierarchicalNum的前缀自增运算符，后缀自增运算符，前缀自减运算符和后缀自减运算符^
/*
//HierarchicalNum.hpp
#include <iostream>
#include <vector>
using namespace std;
class unsignedHierarchicalNum
{
private:
	vector<unsigned int>num;
	unsigned int len;
	unsigned int toUnsignedInt(vector<unsigned int>& num) {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = num.size() - 1;
		while (0 <= it) {
			u_i += num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
	void add(const int addNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) + addNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
	void sub(const int subNum, vector<unsigned int>& n) {
		unsigned int upNum = toUnsignedInt(n) - subNum;
		int it = n.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			n[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? n[it] = upNum : 0;
		}
	}
public:
	unsignedHierarchicalNum(const unsigned int n, const unsigned int numLen = 0) {
		unsigned int tim = 1;
		unsigned int i = numLen ? numLen : 1;
		while (!numLen && tim < n) {
			tim *= ++i;
		}
		this->len = i;
		for (; i; i--) {
			this->num.push_back(0);
		}
		add(n, this->num);
	}
	unsignedHierarchicalNum operator+(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() + n);
		return num;
	}
	unsignedHierarchicalNum operator-(const int n) {
		unsignedHierarchicalNum num(this->toUnsignedInt() - n);
		return num;
	}
	unsignedHierarchicalNum& operator++() {
		add(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator--() {
		sub(1, this->num);
		return *this;
	}
	unsignedHierarchicalNum operator++(int) {
		unsignedHierarchicalNum num = *this;
		add(1, this->num);
		return num;
	}
	unsignedHierarchicalNum operator--(int) {
		unsignedHierarchicalNum num = *this;
		sub(1, this->num);
		return num;
	}
	unsignedHierarchicalNum& operator+=(const int addNum) {
		add(addNum, this->num);
		return *this;
	}
	unsignedHierarchicalNum& operator-=(const int subNum) {
		sub(subNum, this->num);
		return *this;
	}
	unsigned int operator=(unsigned int n) {
		unsigned int upNum = n;
		int it = this->num.size() - 1;
		unsigned int levelUp = 2;
		while (it >= 0) {
			this->num[it] = upNum % levelUp;
			upNum /= levelUp;
			levelUp++;
			it-- ? this->num[it] = upNum : 0;
		}
		return n;
	}
	unsignedHierarchicalNum& operator=(unsignedHierarchicalNum& n) {
		this->len = n.len;
		this->num = n.num;
		return *this;
	}
	unsigned int getPosNum(const unsigned int position) const {
		return position >= num.size() ? NULL : num[position];
	}
	unsigned int toUnsignedInt() {
		unsigned int u_i = 0;
		unsigned int digitNum = 1;
		unsigned int timNum = 2;
		int it = this->num.size() - 1;
		while (0 <= it) {
			u_i += this->num[it--] * digitNum;
			digitNum *= timNum++;
		}
		return u_i;
	}
};
//meiri.cpp
#include <iostream>
#include "HierarchicalNum.hpp"
using namespace std;

int main()
{
    unsignedHierarchicalNum u_n(100, 5);
    for (int i = 0; i < 5; i++) {
        cout << u_n.getPosNum(i);
    }
    cout << endl;
    return 0;
}
*///已修正阶进制数类unsignedHierarchicalNum的有参构造方法，并测试了该类的getPosNum方法^
/*
//meiri.cpp
#include <iostream>
#include "HierarchicalNum.h"
using namespace std;

int main()
{
    unsigned int u_i = 100;
    for (int i = 4; i > 0; i--) {
        cout << getPosNum(u_i, i);
    }
    return 0;
} 
*///已测试新的getPosNum方法的实现^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence(const unsigned int len) {

	}
	Sequence(const vector<T> f_items) {

	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {

	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {

	}
};
*///已新建并基本构建出Sequence类模板^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size();
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		
	}
	T popBackItem(const T item) {

	}
};
*///已新建并实现Sequence类的一些方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		
	}
	T popBackItem(const T item) {

	}
};
*///已修正Sequence类的一些构造方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size() - 1;
	}
	T popBackItem(const T item) {

	}
};
*///已实现Sequence类的pushBackItem方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		int oldSize = this->items.size()
		this->items.push_back(item);
		this->maxNum *= oldSize <= 1 ? 1 : oldSize - 1;
	}
	T popBackItem(const T item) {

	}
};
*///已修正Sequence类的pushBackItem方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {

	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
*///已重新修正pushBackItem方法，并实现了popBackItem方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {
		vector<vector<T>>Sequences;
		Sequences.push_back(this->items);
		this->swapNum = 1;
		while (swapNum < this->maxNum) {
			
			swapNum++;
		}
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
*///已实现Sequence类的getSequence方法的基础^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	vector<vector<T>>getSequence() {
		if (this->items.size()) {
			vector<vector<T>>Sequences;
			Sequences.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			while (swapNum < this->maxNum) {
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				Sequences.push_back(this->items);
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				swapNum++;
			}
		}
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
*///已实现Sequence类的getSequence方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>>getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			while (swapNum < this->maxNum) {
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				Sequences.push_back(this->items);
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				swapNum++;
			}
		}
		return Sequence
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
*///已将一个方法转为私有方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(const unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>>getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			while (swapNum < this->maxNum) {
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				this->sequenceVector.push_back(this->items);
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				swapNum++;
			}
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
*///已修正好Sequence类的getSequence方法^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    Sequence<int>s;
    return 0;
}
*///已测试Sequence类的无参构造方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size() - 1;
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>>getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			while (swapNum < this->maxNum) {
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				this->sequenceVector.push_back(this->items);
				for (swapIndex = 0, index = this->items.size() - 2; index > 0; index--, swapIndex++) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				swapNum++;
			}
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    Sequence<int>s(5);
    return 0;
}
*///已测试并修正了Sequence类的长度构造方法^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1, 2, 3 };
    Sequence<int>s = v;
    return 0;
}
*///已测试Sequence类的vector数组构造方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	bool isUnique(const vector<T> checkVector) {
		for (vector<T> v : this->sequenceVector) {
			if (checkVector == v) {
				return false;
			}
		}
		return true;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size();
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>>getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			vector<T>tempItems = this->items;
			while (swapNum < this->maxNum) {
				for (swapIndex = this->items.size() - 2, index = 0; index < this->items.size() - 1; index++, swapIndex--) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				if (isUnique(this->items)) {
					this->sequenceVector.push_back(this->items);
				}
				this->items = tempItems;
				swapNum++;
			}
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
	}
	T popBackItem(const T item) {
		if (this->items.size()) {
			this->maxNum /= this->items.size();
			this->items.pop_back(item);
		}
	}
};
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1, 2, 3 };
    Sequence<int>s = v;
    vector<vector<int>>vv = s.getSequence();
    for (vector<int> v : vv) {
        for (int i : v) {
            cout << i << " ";
        }
        cout << endl;
    }
    return 0;
}
*///已测试并修正了Sequence类的getSequence方法^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1, 2, 3, 4 };
    Sequence<int>s = v;
    cout << s.sequenceCount() << " ";
    s.getSequence();
    cout << s.sequenceCount() << endl;
    return 0;
}
*///已测试Sequence类的sequenceCount方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	bool isUnique(const vector<T> checkVector) {
		for (vector<T> v : this->sequenceVector) {
			if (checkVector == v) {
				return false;
			}
		}
		return true;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size();
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>>getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			vector<T>tempItems = this->items;
			while (swapNum < this->maxNum) {
				for (swapIndex = this->items.size() - 2, index = 0; index < this->items.size() - 1; index++, swapIndex--) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				if (isUnique(this->items)) {
					this->sequenceVector.push_back(this->items);
				}
				this->items = tempItems;
				swapNum++;
			}
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
		return item;
	}
	T popBackItem() {
		if (this->items.size()) {
			T item = this->items.back();
			this->maxNum /= this->items.size();
			this->items.pop_back();
			return item;
		}
		else {
			return NULL;
		}
	}
};
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1, 2, 3, 4 };
    Sequence<int>sa;
    sa.popBackItem();
    Sequence<int>s = v;
    s.popBackItem();
    s.getSequence();
    cout << s.sequenceCount() << endl;
    return 0;
}
*///已测试并修正了Sequence类的popBackItem方法^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1, 3, 3, 3 };
    Sequence<int>s = v;
    vector<vector<int>>vv = s.getSequence();
    for (vector<int> v : vv) {
        for (int i : v) {
            cout << i << " ";
        }
        cout << endl;
    }
    return 0;
}
*///已测试Sequence类的在Sequence类的items数组中元素不唯一的情况下执行的getSequence方法^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<char>v = { 'a', 'b', 'c', 'd', 'e', 'f', 'g'};
    Sequence<char>s = v;
    vector<vector<char>>vv = s.getSequence();
    for (vector<char> v : vv) {
        for (char ch : v) {
            cout << ch << " ";
        }
        cout << endl;
    }
    return 0;
}
*///Sequence类的最后一次测试^
/*
//stringCalc.h
#pragma once
#include <iostream>
using namespace std;
class stringPlus {
private:
	string last;
public:
	string getLast();
	string calc(string str, string stra);
};
//stringCalc.cpp
#include "stringPlus.h"
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();

	return this->last;
}
*///已构建出stringPlus类的基础^
/*
//stringCalc.cpp
#include "stringPlus.h"
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	bool isAddOne = false;
	bool itIsZero = str.size();
	bool itaIsZero = stra.size();
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero) {
		digitNum = (itIsZero ? 0 : *it++) + (itaIsZero ? 0 : *ita++) + isAddOne;
		isAddOne = digitNum / 10;
		digitNum %= 10;
		this->last.insert(this->last.begin(), '0' + digitNum);
		if (str.crend() == it) {
			itIsZero = true;
		}
		if (stra.crend() == ita) {
			itaIsZero = true;
		}
	}
	return this->last;
}
*///已实现stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	bool isAddOne = false;
	bool itIsZero = str.size();
	bool itaIsZero = stra.size();
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero) {
		digitNum = (itIsZero ? 0 : *it++) + (itaIsZero ? 0 : *ita++) + isAddOne;
		isAddOne = digitNum / 10;
		digitNum %= 10;
		this->last.insert(this->last.begin(), '0' + digitNum);
		if (str.crend() == it) {
			itIsZero = true;
		}
		if (stra.crend() == ita) {
			itaIsZero = true;
		}
	}
	return this->last;
}
*///已实现stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	bool isAddOne = false;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero) {
		digitNum = (itIsZero ? 0 : *it++ - '0') + (itaIsZero ? 0 : *ita++ - '0') + isAddOne;
		isAddOne = digitNum / 10;
		digitNum %= 10;
		this->last.insert(this->last.begin(), '0' + digitNum);
		if (str.crend() == it) {
			itIsZero = true;
		}
		if (stra.crend() == ita) {
			itaIsZero = true;
		}
	}
	return this->last;
}
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
using namespace std;

int main() {
    stringPlus sp;
    string str = sp.calc("11", "11");
    cout << str << endl;
    return 0;
}
*///已初步测试并修正了stringPlus类的calc方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
using namespace std;

int main() {
    stringPlus sp;
    sp.calc("11", "11");
    string str = sp.getLast();
    cout << str << endl;
    return 0;
}
*///已测试stringPlus类的getLast方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	bool isAddOne = false;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero) {
		digitNum = (itIsZero ? 0 : *it++ - '0') + (itaIsZero ? 0 : *ita++ - '0') + isAddOne;
		isAddOne = digitNum / 10;
		digitNum %= 10;
		this->last.insert(this->last.begin(), '0' + digitNum);
		if (str.crend() == it) {
			itIsZero = true;
		}
		if (stra.crend() == ita) {
			itaIsZero = true;
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	return this->last;
}
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.calc("12345", "") << " " << sp.calc("", "") << " " << sp.calc("12345", "12345") << " " << sp.calc("16262323445364387934457643645364", "18231723462347892372349234790") << " " << endl;
    return 0;
}
*///已测试stringPlus类的空字符串计算与大值计算^
/*
//stringCalc.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool isNegative = false;
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		digitNum = (itIsZero ? 0 : (1 - strIsNegative * 2) * (*it - '0')) + (itaIsZero ? 0 : (1 - straIsNegative * 2) * (*ita - '0')) + addNum;
		isNegative = digitNum ? digitNum < 0 : isNegative;
		addNum = (1 - 2 * (itIsZero || str.crend() == it ? 0 : 1 - 2 * strIsNegative * *it) < (itaIsZero || stra.crend() == ita ? 0 : 1 - 2 * straIsNegative * *ita)) * digitNum / 10;
		digitNum = (itIsZero || str.crend() == it ? 0 : 1 - 2 * strIsNegative * *it) < (itaIsZero || stra.crend() == ita ? 0 : 1 - 2 * straIsNegative * *ita) ? 10 + digitNum : abs(digitNum %= 10);
		if (!itaIsZero || !itIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
		(itIsZero || (it++, 0)), (itaIsZero || (ita++, 0));
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///calc方法就先改到这边^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = false;
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy + addNum;
		isNegative = digitNum ? digitNum < 0 : isNegative;
		addNum = tenSub && !itIsZero && iy ? -1 : (ix + iy) / 10;
		digitNum = tenSub && !itIsZero && iy ? abs(ix) + abs(iy) : abs(digitNum %= 10);
		if (!itaIsZero || !itIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///稍微修改了一下calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = false;
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy + addNum;
		isNegative = digitNum ? digitNum < 0 : isNegative;
		addNum = digitNum < 0 ? -1 : digitNum / 10;
		digitNum = abs(digitNum < 0 * 10 + (digitNum % 10));
		if (!itaIsZero || !itIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///再修改了一下calc方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	bool isUnique(const vector<T> checkVector) {
		for (vector<T> v : this->sequenceVector) {
			if (checkVector == v) {
				return false;
			}
		}
		return true;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size();
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>> getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int digitNum = this->items.size() - 1;
			int swapIndex = 0;
			int index = this->items.size() - 2;
			vector<T>tempItems = this->items;
			while (swapNum < this->maxNum) {
				for (swapIndex = this->items.size() - 2, index = 0; index < this->items.size() - 1; index++, swapIndex--) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				if (isUnique(this->items)) {
					this->sequenceVector.push_back(this->items);
				}
				this->items = tempItems;
				swapNum++;
			}
		}
		else {
			this->sequenceVector.push_back(this->items);
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() const {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
		return item;
	}
	T popBackItem() {
		if (this->items.size()) {
			T item = this->items.back();
			this->maxNum /= this->items.size();
			this->items.pop_back();
			return item;
		}
		else {
			return NULL;
		}
	}
};
*///已修正getSequence方法的实现^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1 };
    Sequence<int>s;
    Sequence<int>sa = v;
    s.getSequence();
    sa.getSequence();
    cout << s.sequenceCount() << " " << sa.sequenceCount() << endl;
    return 0;
}
*///已测试Sequence类修正之后的getSequence方法^
/*
//Sequence.hpp
#include <iostream>
#include <vector>
#include "HierarchicalNum.h"
using namespace std;
template<class T>
class Sequence {
private:
	vector<T>items;
	vector<vector<T>>sequenceVector;
	unsigned int maxNum;
	unsigned int swapNum;
	void swapVectorItem(const unsigned int index, const unsigned int indexa) {
		T tempItem = this->items[index];
		this->items[index] = this->items[indexa];
		this->items[indexa] = tempItem;
	}
	bool isUnique(const vector<T> checkVector) {
		for (vector<T> v : this->sequenceVector) {
			if (checkVector == v) {
				return false;
			}
		}
		return true;
	}
public:
	Sequence() {
		this->maxNum = 1;
		this->swapNum = 0;
	}
	Sequence(unsigned int len) {
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = len;
		while (this->maxNum *= factNum, factNum-- > 1){}
		while (len--) { this->items.push_back(0); }
	}
	Sequence(const vector<T> f_items) {
		this->items = f_items;
		this->maxNum = 1;
		this->swapNum = 0;
		unsigned int factNum = this->items.size();
		while (this->maxNum *= factNum, factNum-- > 1){}
	}
	vector<vector<T>> getSequence() {
		this->sequenceVector.clear();
		if (this->items.size()) {
			this->sequenceVector.push_back(this->items);
			this->swapNum = 1;
			int swapIndex = this->items.size() - 2;
			int index = 0;
			vector<T>tempItems = this->items;
			while (swapNum < this->maxNum) {
				for (swapIndex = this->items.size() - 2, index = 0; index < this->items.size() - 1; index++, swapIndex--) {
					swapVectorItem(index, index + getPosNum(swapNum, swapIndex));
				}
				if (isUnique(this->items)) {
					this->sequenceVector.push_back(this->items);
				}
				this->items = tempItems;
				swapNum++;
			}
		}
		else {
			this->sequenceVector.push_back(this->items);
		}
		return this->sequenceVector;
	}
	unsigned int sequenceCount() const {
		return this->sequenceVector.size();
	}
	T pushBackItem(const T item) {
		this->items.push_back(item);
		this->maxNum *= this->items.size();
		return item;
	}
	T popBackItem() {
		if (this->items.size()) {
			T item = this->items.back();
			this->maxNum /= this->items.size();
			this->items.pop_back();
			return item;
		}
		else {
			return NULL;
		}
	}
};
*///已删除Sequence类中的getSequence方法中的多余的digitNum变量^
/*
//meiri.cpp
#include <iostream>
#include "Sequence.hpp"
using namespace std;

int main()
{
    vector<int>v = { 1 };
    vector<int>va = { 1, 2, 3, 4 };
    Sequence<int>s;
    Sequence<int>sa = v;
    Sequence<int>sc = va;
    s.getSequence();
    sa.getSequence();
    vector<vector<int>>vv = sc.getSequence();
    cout << s.sequenceCount() << " " << sa.sequenceCount() << " " << sc.sequenceCount() << endl;
    for (vector<int> v : vv) {
        for (int i : v) {
            cout << i << " ";
        }
        cout << endl;
    }
    return 0;
}
*///已测试删掉多余变量digitNum之后的Sequence类的getSequence方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == false;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy + addNum;
		addNum = digitNum < 0 ? -1 : digitNum / 10;
		digitNum = abs(digitNum < 0 * 10 + (digitNum % 10));
		if (!itaIsZero || !itIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///已重新初始化变量isNegative^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == false;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy + !(0 > addNum && 2 == itIsZero + itaIsZero) * addNum;
		addNum = abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itaIsZero || !itIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///stringPlus类的calc方法结果的准确率已上升到50%左右^
/*
//stringCalc.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == false;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///修改了一下stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
*///再修改了一下stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while (('0' > this->last[id] || '9' < this->last[id]) && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		this->last.erase(id);
	}
	return this->last;
}
*///修改了一下stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///calc方法基本无问题^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.calc("-100", "1") <<  endl;
    return 0;
}
*///已测试新的strinmgPlus类新的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已再次优化stringPlus类的calc方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已新添stringPlus类中calc方法的str和stra字符串的过滤无效字符功能^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.calc("-1|0", "7a6") <<  endl;
    return 0;
}
*///已测试stringPlus类的过滤无效字符功能^
/*
//stringPlus.h
#pragma once
#include <iostream>
using namespace std;
class stringPlus {
protected:
	string last;
public:
	virtual string getLast();
	virtual string calc(string str, string stra);
};
*///已修改stringPlus类的构造^
/*
//stringSub.h
#pragma once
#include "stringPlus.h"
#include <iostream>
using namespace std;
class stringSub : public stringPlus {
public:
	string calc(string str, string stra);
};
//stringSub.cpp
#include "stringSub.h"
string stringSub::calc(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = !(stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已新建stringSub.h与stringSub.cpp程序文件^
/*
//stringPlus.h
#pragma once
#include <iostream>
using namespace std;
class stringPlus {
protected:
	string last;
public:
	virtual string getLast();
	virtual string add(string str, string stra);
};
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
//stringSub.h
#pragma once
#include "stringPlus.h"
#include <iostream>
using namespace std;
class stringSub{
private:
	string last;
public:
	string getLast();
	string sub(string str, string stra);
};
//stringSub.cpp
#include "stringSub.h"
string stringSub::getLast() {
	return this->last;
}
string stringSub::sub(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = !(stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	bool isNegative = '-' == (abs(atoi(str.c_str())) > abs(atoi(stra.c_str())) ? str.front() : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已更改stringPlus类与stringSub类的方法名字^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修改isNegative变量的初始化方式^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修改last字符串的删除多余字符的方式^
/*
//stringSub.cpp
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = !(stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修改stringSub类的sub方法^
/*
//stringPlus.cpp
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修改stringPlus类的add方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
using namespace std;

int main() {
    stringPlus sp;
    stringSub ss;
    cout << ss.sub(sp.add("3", ""), "2");
    return 0;
}
*///已测试stringPlus类和stringSub类的字符串混合计算^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修正stringPlus方法中的一些bug^
/*
//stringSub.cpp
#include "stringSub.h"
string stringSub::getLast() {
	return this->last;
}
string stringSub::sub(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if ('-' != stra.front()) {
		stra.insert(0, "-");
	}
	else {
		for (int i = 0; i < stra.size() - 1; i++) {
			stra[i] = stra[i + 1];
		}
		stra.pop_back();
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
*///已修正stringSub类的sub方法中stra转负数的操作^
/*
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
		if ('-' == timStr[0] && '-' == timStr[1]) {
			for (int i = 0; i < timStr.size() - 2; i++) {
				timStr[i] = timStr[i + 2];
			}
			timStr.erase(timStr.size() - 2);
		}
	}
	this->last = timStr;
	return timStr;
}
*///stringTim类的tim方法已基本无bug^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include <set>
using namespace std;

int main() {
    stringTim st;
    cout << st.tim("22", "22");
    return 0;
}
*///测试一下stringTim类的tim方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include <set>
using namespace std;

int main() {
    stringTim st;
    string timStr = "1";
    int i = 0;
    cout << "请输入你要求的2的次方数：";
    cin >> i;
    if (i < 0) {
        cout << "不支持" << endl;
        return 1;
    }
    for (; i; i--) {
        timStr = st.tim(timStr, "2");
    }
    cout << timStr << endl;
    return 0;
}
*///2的几次方计算器^
/*
//stringTim.h
#pragma once
#include "stringPlus.h"
class stringTim : public stringPlus {
public:
	virtual string tim(string str, string stra);
};
*///已将tim方法设为虚方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include <set>
using namespace std;

int main() {
    stringTim st;
    stringPlus sp;
    cout << sp.add(st.tim("29", "6"), st.tim("29", "4")) << endl;
    return 0;
}
*///乘法分配律^
/*
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
*///已实现stringDiv类的div方法^
/*
//stringPlus.h
#pragma once
#include <iostream>
using namespace std;
class stringPlus {
protected:
        string last;
public:
        virtual string getLast();
        virtual string add(string str, string stra);
        virtual string addAssign(string& str, string stra);
};
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
        return this->last;
}
string stringPlus::add(string str, string stra) {
        this->last.clear();
        int addNum = 0;
        int ix = 0;
        int iy = 0;
        int id = 0;
        int toDel = 0;
        string tempstr;
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
                str.swap(stra);
        }
        bool itIsZero = !str.size();
        bool itaIsZero = !stra.size();
        bool strIsNegative = (str.size() ? '-' == str.front() : false);
        bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
        bool tenSub = 1 == strIsNegative + straIsNegative;
        int absStr = abs(atoi(str.c_str()));
        int absStra = abs(atoi(stra.c_str()));
        bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
        auto it = str.crbegin();
        auto ita = stra.crbegin();
        int digitNum = 0;
        while (!itaIsZero || !itIsZero || addNum) {
                if (str.crend() == it || '0' > *it || '9' < *it) {
                        itIsZero = true;
                }
                if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
                        itaIsZero = true;
                }
                ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
                iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
                digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
                digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
                addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
                digitNum = abs(digitNum % 10);
                if (!itIsZero || !itaIsZero || addNum || digitNum) {
                        this->last.insert(this->last.begin(), '0' + digitNum);
                }
        }
        if (this->last.empty()) {
                this->last.push_back('0');
        }
        else if (isNegative) {
                this->last.insert(this->last.begin(), '-');
        }
        while ('-' == this->last[id] && id < this->last.size()) {
                id++;
        }
        while (id < this->last.size() - 1 && '0' == this->last[id]) {
                toDel = 0;
                while (toDel < this->last.size()) {
                        if (toDel == id && ++toDel) {
                                continue;
                        }
                        tempstr.push_back(this->last[toDel++]);
                }
                this->last = tempstr;
        }
        return this->last;
}
string stringPlus::addAssign(string& str, string stra) {
        this->last.clear();
        int addNum = 0;
        int ix = 0;
        int iy = 0;
        int id = 0;
        int toDel = 0;
        string tempstr;
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
                str.swap(stra);
        }
        bool itIsZero = !str.size();
        bool itaIsZero = !stra.size();
        bool strIsNegative = (str.size() ? '-' == str.front() : false);
        bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
        bool tenSub = 1 == strIsNegative + straIsNegative;
        int absStr = abs(atoi(str.c_str()));
        int absStra = abs(atoi(stra.c_str()));
        bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
        auto it = str.crbegin();
        auto ita = stra.crbegin();
        int digitNum = 0;
        while (!itaIsZero || !itIsZero || addNum) {
                if (str.crend() == it || '0' > *it || '9' < *it) {
                        itIsZero = true;
                }
                if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
                        itaIsZero = true;
                }
                ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
                iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
                digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
                digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
                addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
                digitNum = abs(digitNum % 10);
                if (!itIsZero || !itaIsZero || addNum || digitNum) {
                        this->last.insert(this->last.begin(), '0' + digitNum);
                }
        }
        if (this->last.empty()) {
                this->last.push_back('0');
        }
        else if (isNegative) {
                this->last.insert(this->last.begin(), '-');
        }
        while ('-' == this->last[id] && id < this->last.size()) {
                id++;
        }
        while (id < this->last.size() - 1 && '0' == this->last[id]) {
                toDel = 0;
                while (toDel < this->last.size()) {
                        if (toDel == id && ++toDel) {
                                continue;
                        }
                        tempstr.push_back(this->last[toDel++]);
                }
                this->last = tempstr;
        }
        return str = this->last;
}
//stringSub.h
#pragma once
#include "stringPlus.h"
#include <iostream>
using namespace std;
class stringSub{
protected:
        string last;
public:
        virtual string getLast();
        virtual string sub(string str, string stra);
        virtual string subAssign(string& str, string stra);
};
//stringSub.cpp
#include "stringSub.h"
string stringSub::getLast() {
        return this->last;
}
string stringSub::sub(string str, string stra) {
        this->last.clear();
        int addNum = 0;
        int ix = 0;
        int iy = 0;
        int id = 0;
        int toDel = 0;
        string tempstr;
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        if ('-' != stra.front()) {
                stra.insert(0, "-");
        }
        else {
                for (int i = 0; i < stra.size() - 1; i++) {
                        stra[i] = stra[i + 1];
                }
                stra.pop_back();
        }
        if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
                str.swap(stra);
        }
        auto it = str.crbegin();
        auto ita = stra.crbegin();
        bool itIsZero = !str.size();
        bool itaIsZero = !stra.size();
        bool strIsNegative = (str.size() ? '-' == str.front() : false);
        bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
        bool tenSub = 1 == strIsNegative + straIsNegative;
        int absStr = abs(atoi(str.c_str()));
        int absStra = abs(atoi(stra.c_str()));
        bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
        int digitNum = 0;
        while (!itaIsZero || !itIsZero || addNum) {
                if (str.crend() == it || '0' > *it || '9' < *it) {
                        itIsZero = true;
                }
                if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
                        itaIsZero = true;
                }
                ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
                iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
                digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
                digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
                addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
                digitNum = abs(digitNum % 10);
                if (!itIsZero || !itaIsZero || addNum || digitNum) {
                        this->last.insert(this->last.begin(), '0' + digitNum);
                }
        }
        if (this->last.empty()) {
                this->last.push_back('0');
        }
        else if (isNegative) {
                this->last.insert(this->last.begin(), '-');
        }
        while ('-' == this->last[id] && id < this->last.size()) {
                id++;
        }
        while (id < this->last.size() - 1 && '0' == this->last[id]) {
                toDel = 0;
                while (toDel < this->last.size()) {
                        if (toDel == id && ++toDel) {
                                continue;
                        }
                        tempstr.push_back(this->last[toDel++]);
                }
                this->last = tempstr;
        }
        return this->last;
}
string stringSub::subAssign(string& str, string stra) {
        this->last.clear();
        int addNum = 0;
        int ix = 0;
        int iy = 0;
        int id = 0;
        int toDel = 0;
        string tempstr;
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        if ('-' != stra.front()) {
                stra.insert(0, "-");
        }
        else {
                for (int i = 0; i < stra.size() - 1; i++) {
                        stra[i] = stra[i + 1];
                }
                stra.pop_back();
        }
        if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
                str.swap(stra);
        }
        auto it = str.crbegin();
        auto ita = stra.crbegin();
        bool itIsZero = !str.size();
        bool itaIsZero = !stra.size();
        bool strIsNegative = (str.size() ? '-' == str.front() : false);
        bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
        bool tenSub = 1 == strIsNegative + straIsNegative;
        int absStr = abs(atoi(str.c_str()));
        int absStra = abs(atoi(stra.c_str()));
        bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
        int digitNum = 0;
        while (!itaIsZero || !itIsZero || addNum) {
                if (str.crend() == it || '0' > *it || '9' < *it) {
                        itIsZero = true;
                }
                if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
                        itaIsZero = true;
                }
                ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
                iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
                digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
                digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
                addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
                digitNum = abs(digitNum % 10);
                if (!itIsZero || !itaIsZero || addNum || digitNum) {
                        this->last.insert(this->last.begin(), '0' + digitNum);
                }
        }
        if (this->last.empty()) {
                this->last.push_back('0');
        }
        else if (isNegative) {
                this->last.insert(this->last.begin(), '-');
        }
        while ('-' == this->last[id] && id < this->last.size()) {
                id++;
        }
        while (id < this->last.size() - 1 && '0' == this->last[id]) {
                toDel = 0;
                while (toDel < this->last.size()) {
                        if (toDel == id && ++toDel) {
                                continue;
                        }
                        tempstr.push_back(this->last[toDel++]);
                }
                this->last = tempstr;
        }
        return str = this->last;
}
//stringTim.h
#pragma once
#include "stringPlus.h"
class stringTim : public stringPlus {
public:
        virtual string tim(string str, string stra);
        virtual string timAssign(string& str, string stra);
};
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
        string timStr = "0";
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
        int i = abs(atoi(stra.c_str()));
        for (; i; i--) {
                timStr = add(timStr, str);
        }
        if (isNegative) {
                timStr.insert(0, "-");
                if ('-' == timStr[0] && '-' == timStr[1]) {
                        for (int i = 0; i < timStr.size() - 2; i++) {
                                timStr[i] = timStr[i + 2];
                        }
                        timStr.erase(timStr.size() - 2);
                }
        }
        this->last = timStr;
        return timStr;
}
string stringTim::timAssign(string& str, string stra) {
        string timStr = "0";
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
        int i = abs(atoi(stra.c_str()));
        for (; i; i--) {
                timStr = add(timStr, str);
        }
        if (isNegative) {
                timStr.insert(0, "-");
                if ('-' == timStr[0] && '-' == timStr[1]) {
                        for (int i = 0; i < timStr.size() - 2; i++) {
                                timStr[i] = timStr[i + 2];
                        }
                        timStr.erase(timStr.size() - 2);
                }
        }
        str = this->last = timStr;
        return timStr;
}
//stringDiv.h
#pragma once
#include "stringSub.h"
class stringDiv : public stringSub {
public:
        virtual string div(string str, string stra);
        virtual string divAssign(string& str, string stra);
};
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
        '-' == str.front() ? str = sub("0", str) : "";
        '-' == stra.front() ? stra = sub("0", stra) : "";
        string divStr = "0";
        while (atoi(sub(str, stra).c_str()) >= 0) {
                str = sub(str, stra);
                divStr = sub(divStr, "-1");
        }
        if (isNegative) {
                divStr.insert(0, "-");
        }
        this->last = divStr;
        return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
        for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
                if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
                        str.erase(index);
                }
                if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
                        stra.erase(index);
                }
        }
        bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
        '-' == str.front() ? str = sub("0", str) : "";
        '-' == stra.front() ? stra = sub("0", stra) : "";
        string divStr = "0";
        while (atoi(sub(str, stra).c_str()) >= 0) {
                str = sub(str, stra);
                divStr = sub(divStr, "-1");
        }
        if (isNegative) {
                divStr.insert(0, "-");
        }
        str = this->last = divStr;
        return divStr;
}
*///已往stringPlus类，stringSub类，stringTim类和stringDiv类，添加所对应的assign方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include <set>
using namespace std;

int main() {
    stringPlus sp;
    stringSub ss;
    stringTim st;
    stringDiv sd;
    string str = "0";
    sp.addAssign(str, "5");
    cout << str << " ";
    ss.subAssign(str, "3");
    cout << str << " ";
    st.timAssign(str, "2");
    cout << str << " ";
    sd.divAssign(str, "4");
    cout << str << endl;
    return 0;
}
*///已测试stringPlus类，stringSub类，stringTim类和stringDiv类所对应的assign方法^
/*
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
*///已修正stringDiv的div和divAssign方法的可以除以0的bug^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include <set>
using namespace std;

int main() {
    stringDiv ss;
    cout << ss.div("33", "-0") << endl;
    cout << "OK" << endl;
    return 0;
}
*///已测试stringDiv类的div方法是否可以除以0^
/*
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
*///已为stringDiv类的整数除法计算方法添加错误提示^
/*
//stringMod.h
#pragma once
#include "stringSub.h"
class stringMod : public stringSub {
public:
	string mod(string str, string stra);
	string modAssign(string& str, string stra);
};
//stringMod.cpp
#include "stringMod.h"
string stringMod::mod(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = '-' == str.front();
	str = (('-' == str.front()) ? sub("0", str) : str);
	stra = (('-' == stra.front()) ? sub("0", stra) : stra);
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	while (atoi(sub(str, stra).c_str()) >= 0) {
		subAssign(str, stra);
	}
	if (isNegative) {
		str.insert(0, "-");
	}
	this->last = str;
	return str;
}
string stringMod::modAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = '-' == str.front();
	str = (('-' == str.front()) ? sub("0", str) : str);
	stra = (('-' == stra.front()) ? sub("0", stra) : stra);
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	while (atoi(sub(str, stra).c_str()) >= 0) {
		subAssign(str, stra);
	}
	if (isNegative) {
		str.insert(0, "-");
	}
	this->last = str;
	return str;
}
*///已创建stringMod类，并实现该类的相关方法^
/*
//stringMod.h
#pragma once
#include "stringTim.h"
#include "stringDiv.h"
class stringMod : public stringTim, public stringDiv {
	string last;
public:
	string getLast();
	string mod(string str, string stra);
	string modAssign(string& str, string stra);
};


//stringMod.cpp
#include "stringMod.h"
string stringMod::mod(string str, string stra) {
	this->last = sub(str, tim(stra, div(str, stra)));
	return str;
}
string stringMod::modAssign(string& str, string stra) {
	this->last = subAssign(str, tim(stra, div(str, stra)));
	return str;
}
string stringMod::getLast() {
	return this->last;
}
*///已重新实现stringMod类的mod计算方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include <set>
using namespace std;

int main() {
    stringMod sm;
    cout << -1 % -3 << endl;
    cout << sm.mod("-1", "-3") << endl;
    cout << sm.getLast();
    return 0;
}
*///已再次测试stringMod类的mod计算方法^
/*
//stringTim.h
#pragma once
#include "stringPlus.h"
class stringTim : protected stringPlus {
protected:
	string last;
public:
	virtual string getLast();
	virtual string tim(string str, string stra);
	virtual string timAssign(string& str, string stra);
};
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
		if ('-' == timStr[0] && '-' == timStr[1]) {
			for (int i = 0; i < timStr.size() - 2; i++) {
				timStr[i] = timStr[i + 2];
			}
			timStr.erase(timStr.size() - 2);
		}
	}
	this->last = timStr;
	return timStr;
}
string stringTim::timAssign(string& str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
		if ('-' == timStr[0] && '-' == timStr[1]) {
			for (int i = 0; i < timStr.size() - 2; i++) {
				timStr[i] = timStr[i + 2];
			}
			timStr.erase(timStr.size() - 2);
		}
	}
	str = this->last = timStr;
	return timStr;
}
string stringTim::getLast() {
	return this->last;
}
//stringDiv.h
#pragma once
#include "stringSub.h"
class stringDiv : protected stringSub {
protected:
	string last;
public:
	virtual string getLast();
	virtual string div(string str, string stra);
	virtual string divAssign(string& str, string stra);
};


//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
string stringDiv::getLast() {
	return this->last;
}
*///已修改stringTim类和stringDiv类^
/*
//stringDiv.h
#pragma once
#include "stringSub.h"
class stringDiv : protected stringSub {
protected:
	string last;
public:
	virtual string getLast();
	virtual string div(string str, string stra);
	virtual string divAssign(string& str, string stra);
	virtual string div(string str, string stra, bool isUp);
	virtual string divAssign(string& str, string stra, bool isUp);
};

//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
string stringDiv::getLast() {
	return this->last;
}
string stringDiv::div(string str, string stra, bool isUp){
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp ? subAssign(divStr, "-1") : "";
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra, bool isUp) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp ? subAssign(divStr, "-1") : "";
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
*///已添加stringDiv类的div重载方法和divAssign重载方法^
/*
//stringMod.cpp
#include "stringMod.h"
string stringMod::mod(string str, string stra) {
	this->last = sub(str, tim(stra, div(str, stra, false)));
	return this->last;
}
string stringMod::modAssign(string& str, string stra) {
	this->last = subAssign(str, tim(stra, div(str, stra, false)));
	return this->last;
}
string stringMod::getLast() {
	return this->last;
}
*///已更改stringMod类中的mod计算方法的实现^
/*
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	this->last = timStr;
	return timStr;
}
string stringTim::timAssign(string& str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	str = this->last = timStr;
	return timStr;
}
string stringTim::getLast() {
	return this->last;
}
*///已修改stringTim类的tim计算方法^
/*
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	this->last = timStr;
	return timStr;
}
string stringTim::timAssign(string& str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	str = this->last = timStr;
	return timStr;
}
string stringTim::getLast() {
	return this->last;
}
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
string stringDiv::getLast() {
	return this->last;
}
string stringDiv::div(string str, string stra, bool isUp){
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra, bool isUp) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
*///已为stringTim类和stringDiv类的计算方法中添加字符串为空的检测^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include <set>
using namespace std;

int main() {
    stringTim st;
    stringDiv sd;
    cout << st.tim("", "") << endl;
    cout << sd.div("", "") << endl;
    return 0;
}
*///已测试stringTim类和stringDiv类的计算方法中添加字符串为空的检测^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include <set>
using namespace std;

int main() {
    stringPlus sp;
    stringSub ss;
    stringTim st;
    stringDiv sd;
    cout << st.tim(sp.add(sd.div("3", "1"), ss.sub("5", "2")), "6") << endl;
    return 0;
}
*///四则计算^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include <set>
using namespace std;

int main() {
    stringMod sm;
    cout << sm.mod(sm.mod("7", "2"), "2");
    return 0;
}
*///双重无用mod^
/*
//stringPow.h
#pragma once
#include "stringDiv.h"
class stringPow : protected stringDiv {
	string last;
public:
	string getLast();
};
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
*///已创建stringPow类^
/*
//stringPow.h
#pragma once
#include "stringDiv.h"
class stringPow : protected stringDiv {
	string last;
public:
	string getLast();
	string pow(string str, string stra);
	string powAssign(string& str, string stra);
};
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
string stringPow::pow(string str, string stra) {
	return this->last;
}
string stringPow::powAssign(string& str, string stra) {
	return this->last;
}
*///已新建一个pow方法和一个powAssign方法^
/*
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
string stringPow::pow(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	string powStr = "1";
	if ('-' == stra.front()) {
		return this->last = "0";
	}
	else {
		int i = atoi(stra.c_str());
		for (; i; i--) {
			timAssign(powStr, str);
		}
	}
	return this->last = powStr;
}
string stringPow::powAssign(string& str, string stra) {
	return this->last;
}
*///已实现pow方法^
/*
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
string stringPow::pow(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	string powStr = "1";
	if ('-' == stra.front()) {
		return this->last = "0";
	}
	else {
		int i = atoi(stra.c_str());
		for (; i; i--) {
			timAssign(powStr, str);
		}
	}
	return this->last = powStr;
}
string stringPow::powAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	string powStr = "1";
	if ('-' == stra.front()) {
		return this->last = "0";
	}
	else {
		int i = atoi(stra.c_str());
		for (; i; i--) {
			timAssign(powStr, str);
		}
	}
	return this->last = str = powStr;
}
*///已实现powAssign方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include <set>
using namespace std;

int main() {
    stringPow sa;
    cout << sa.pow("2", "3") << endl;
    return 0;
}
*///测试stringPow类的pow方法^
/*
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
string stringDiv::getLast() {
	return this->last;
}
string stringDiv::div(string str, string stra, bool isUp){
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra, bool isUp) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
*///已修正stringDiv类的div及一系列计算方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include <set>
using namespace std;

int main() {
    stringPow sa;
    cout << sa.pow("-2", "-3") << endl;
    return 0;
}
*///已测试stringPow类pow方法的次方计算^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include <set>
using namespace std;

int main() {
    stringPow sa;
    cout << sa.pow("1", "-1000") << endl;
    cout << sa.pow("-1", "-1000") << endl;
    return 0;
}
*///已测试stringPow类pow方法的基数为1或-1的计算^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include <set>
using namespace std;

int main() {
    stringPlus sa;
    stringPow sp;
    cout << "3^2 + 4^2 = " << sa.add(sp.pow("3", "2"), sp.pow("4", "2")) << endl;
    return 0;
}
*///勾股定理^
/*
//stringTimDecimal.h
#pragma once
#include "stringTim.h"
class stringTimDecimal : protected stringTim{
	string last;
public:
	virtual string getLast();
	virtual string timDecimal(string str, string stra);
	virtual string timDecimalAssign(string& str, string stra);
};


//stringTimDecimal.cpp
#include "stringTimDecimal.h"
string stringTimDecimal::getLast() {
	return this->last;
}
string stringTimDecimal::timDecimal(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != str[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	int dotBackNum = (str.size() - 1 - str.find('.')) + (stra.size() - 1 - stra.find('.'));
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	timStr.insert(timStr.size() - dotBackNum, ".");
	int dotIndex = timStr.size() - dotBackNum;
	bool canDelete = true;
	for (int i = dotIndex + 1; i < timStr.size(); i++) {
		if ('0' != timStr[i]) {
			canDelete = false;
			break;
		}
	}
	if (canDelete) {
		timStr.erase(dotIndex);
	}
	return this->last = timStr;
}
string stringTimDecimal::timDecimalAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != str[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	int dotBackNum = (str.size() - 1 - str.find('.')) + (stra.size() - 1 - stra.find('.'));
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	timStr.insert(timStr.size() - dotBackNum, ".");
	int dotIndex = timStr.size() - dotBackNum;
	bool canDelete = true;
	for (int i = dotIndex + 1; i < timStr.size(); i++) {
		if ('0' != timStr[i]) {
			canDelete = false;
			break;
		}
	}
	if (canDelete) {
		timStr.erase(dotIndex);
	}
	return this->last = str = timStr;
}
*///已实现stringTimDecimal类的timDecimal等方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include <set>
using namespace std;

int main() {
    stringTimDecimal std;
    cout << std.timDecimal("10", "0.1") << endl; 
    return 0;
}
*///测试stringTimDecimal类的timDecimal方法^
/*
//stringTimDecimal.cpp
#include "stringTimDecimal.h"
string stringTimDecimal::getLast() {
	return this->last;
}
string stringTimDecimal::timDecimal(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("\\.0*$");
	timStr.insert(dotIndex, ".");
	timStr = regex_replace(timStr, correntNumRegex, "");
	return this->last = timStr;
}
string stringTimDecimal::timDecimalAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("\\.0*$");
	timStr.insert(dotIndex, ".");
	timStr = regex_replace(timStr, correntNumRegex, "");
	return this->last = str = timStr;
}
*///已修正timDecimal方法^
/*
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	regex delRegex("^0+");
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	this->last = regex_replace(this->last, delRegex, "");
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
string stringPlus::addAssign(string& str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	regex delRegex("^0+");
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	this->last = regex_replace(this->last, delRegex, "");
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return str = this->last;
}
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	if (abs(atoi(str.c_str())) < abs(atoi(stra.c_str()))) {
		str.swap(stra);
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	this->last = timStr;
	return timStr;
}
string stringTim::timAssign(string& str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	if (abs(atoi(str.c_str())) < abs(atoi(stra.c_str()))) {
		str.swap(stra);
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	str = this->last = timStr;
	return timStr;
}
string stringTim::getLast() {
	return this->last;
}
*///已优化stringTim类的tim计算方法，并修正stringPlus类中add方法中的有多余0的处理错误^
/*
//stringMod.h
#pragma once
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
class stringMod : protected stringDiv {
protected:
	string last;
public:
	string getLast();
	string mod(string str, string stra);
	string modAssign(string& str, string stra);
};

//stringPow.h
#pragma once
#include "stringDiv.h"
class stringPow : protected stringDiv {
protected:
	string last;
public:
	string getLast();
	string pow(string str, string stra);
	string powAssign(string& str, string stra);
};
//stringTimDecimal.h
#pragma once
#include "stringTim.h"
#include <regex>
class stringTimDecimal : protected stringTim {
protected:
	string last;
public:
	virtual string getLast();
	virtual string timDecimal(string str, string stra);
	virtual string timDecimalAssign(string& str, string stra);
};

*///已修改stringMod类，stringPow类，和stringTimDecimal类^
/*
//stringPlusDecimal.h
#pragma once
#include "stringTimDecimal.h"
class stringPlusDecimal : public stringTimDecimal {
protected:
	string last;
public:
	virtual string getLast();
	virtual string addDecimal(string str, string stra);
	virtual string addDecimalAssign(string& str, string stra);
};

//stringPlusDecimal.cpp
#include "stringPlusDecimal.h"
string stringPlusDecimal::getLast() {
	return this->last;
}
string stringPlusDecimal::addDecimal(string str, string stra) {
	regex dotRegex("\\.");
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	int strDotBackNum = regex_search(str, dotRegex) * (str.size() - str.find('.') - 1);
	int straDotBackNum = regex_search(stra, dotRegex) * (stra.size() - stra.find('.') - 1);
	int maxDotBackNum = strDotBackNum > straDotBackNum ? strDotBackNum : straDotBackNum;
	string strDigit = regex_replace(str, dotRegex, "");
	string straDigit = regex_replace(stra, dotRegex, "");
	if (strDotBackNum != maxDotBackNum) {
		strDigit.append(string(maxDotBackNum - strDotBackNum, '0'));
	} 
	else if (straDotBackNum != maxDotBackNum) {
		straDigit.append(string(maxDotBackNum - straDotBackNum, '0'));
	}
	string addStr = add(strDigit, straDigit);
	string timStr = "1";
	timStr.insert(0, string(maxDotBackNum, '0'));
	timStr.insert(1, ".");
	return addStr = timDecimal(addStr, timStr);
}
string stringPlusDecimal::addDecimalAssign(string& str, string stra) {
	regex dotRegex("\\.");
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	int strDotBackNum = regex_search(str, dotRegex) * (str.size() - str.find('.') - 1);
	int straDotBackNum = regex_search(stra, dotRegex) * (stra.size() - stra.find('.') - 1);
	int maxDotBackNum = strDotBackNum > straDotBackNum ? strDotBackNum : straDotBackNum;
	string strDigit = regex_replace(str, dotRegex, "");
	string straDigit = regex_replace(stra, dotRegex, "");
	if (strDotBackNum != maxDotBackNum) {
		strDigit.append(string(maxDotBackNum - strDotBackNum, '0'));
	}
	else if (straDotBackNum != maxDotBackNum) {
		straDigit.append(string(maxDotBackNum - straDotBackNum, '0'));
	}
	string addStr = add(strDigit, straDigit);
	string timStr = "1";
	timStr.insert(0, string(maxDotBackNum, '0'));
	timStr.insert(1, ".");
	return addStr = str = timDecimal(addStr, timStr);
}
*///已添加stringPlusDecimal类，并实现其中的一些方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include <set>
using namespace std;

int main() {
    stringPlusDecimal sp;
    cout << sp.addDecimal("1.23", "2.3") << endl;
    return 0;
}
*///已测试stringPlusDecimal的addDecimal方法^
/*
//stringTimDecimal.cpp
#include "stringTimDecimal.h"
string stringTimDecimal::getLast() {
	return this->last;
}
string stringTimDecimal::timDecimal(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = timStr;
}
string stringTimDecimal::timDecimalAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && '-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && '-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = str = timStr;
}
*///已解决小数乘法计算中有多余数字的bug^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include <set>
using namespace std;

int main() {
    stringPlusDecimal sp;
    cout << sp.addDecimal("0.001", "100.009") << endl;
    cout << sp.addDecimal("-0.001", "100.009") << endl;
    cout << sp.addDecimal("-0.001", "-100.009") << endl;
    cout << sp.addDecimal("0.001", "-100.009") << endl;
    return 0;
}
*///已测试小数加法中负数的运算^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include <set>
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.add("1-0", "1-9") << endl;
    return 0;
}
*///已测试异常计算^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include <set>
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.add("1-0", "1-9") << endl;
    return 0;
}
*///已测试异常计算^
/*
//stringDiv.cpp
#include "stringDiv.h"
string stringDiv::div(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}
string stringDiv::getLast() {
	return this->last;
}
string stringDiv::div(string str, string stra, bool isUp){
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	this->last = divStr;
	return divStr;
}
string stringDiv::divAssign(string& str, string stra, bool isUp) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	bool isNegative = (1 == ('-' == str.front()) + ('-' == stra.front()));
	'-' == str.front() ? str = sub("0", str) : "";
	'-' == stra.front() ? stra = sub("0", stra) : "";
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	string divStr = "0";
	while (atoi(sub(str, stra).c_str()) >= 0) {
		str = sub(str, stra);
		divStr = sub(divStr, "-1");
	}
	1 == isNegative + isUp && "0" != str ? subAssign(divStr, "-1") : "";
	if (isNegative && "0" != divStr) {
		divStr.insert(0, "-");
	}
	str = this->last = divStr;
	return divStr;
}#include "stringMod.h"
string stringMod::mod(string str, string stra) {
	this->last = sub(str, tim(stra, div(str, stra, false)));
	return this->last;
}
string stringMod::modAssign(string& str, string stra) {
	this->last = subAssign(str, tim(stra, div(str, stra, false)));
	return this->last;
}
string stringMod::getLast() {
	return this->last;
}
//stringPlus.cpp
#include "stringPlus.h"
#include <cmath>	
string stringPlus::getLast() {
	return this->last;
}
string stringPlus::add(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	regex delRegex("^0+");
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	this->last = regex_replace(this->last, delRegex, "");
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return this->last;
}
string stringPlus::addAssign(string& str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	int digitNum = 0;
	regex delRegex("^0+");
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	this->last = regex_replace(this->last, delRegex, "");
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	return str = this->last;
}
//stringPlusDecimal.cpp
#include "stringPlusDecimal.h"
string stringPlusDecimal::getLast() {
	return this->last;
}
string stringPlusDecimal::addDecimal(string str, string stra) {
	regex dotRegex("\\.");
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	int strDotBackNum = regex_search(str, dotRegex) * (str.size() - str.find('.') - 1);
	int straDotBackNum = regex_search(stra, dotRegex) * (stra.size() - stra.find('.') - 1);
	int maxDotBackNum = strDotBackNum > straDotBackNum ? strDotBackNum : straDotBackNum;
	string strDigit = regex_replace(str, dotRegex, "");
	string straDigit = regex_replace(stra, dotRegex, "");
	if (strDotBackNum != maxDotBackNum) {
		strDigit.append(string(maxDotBackNum - strDotBackNum, '0'));
	} 
	else if (straDotBackNum != maxDotBackNum) {
		straDigit.append(string(maxDotBackNum - straDotBackNum, '0'));
	}
	string addStr = add(strDigit, straDigit);
	string timStr = "1";
	timStr.insert(0, string(maxDotBackNum, '0'));
	timStr.insert(1, ".");
	return addStr = timDecimal(addStr, timStr);
}
string stringPlusDecimal::addDecimalAssign(string& str, string stra) {
	regex dotRegex("\\.");
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	int strDotBackNum = regex_search(str, dotRegex) * (str.size() - str.find('.') - 1);
	int straDotBackNum = regex_search(stra, dotRegex) * (stra.size() - stra.find('.') - 1);
	int maxDotBackNum = strDotBackNum > straDotBackNum ? strDotBackNum : straDotBackNum;
	string strDigit = regex_replace(str, dotRegex, "");
	string straDigit = regex_replace(stra, dotRegex, "");
	if (strDotBackNum != maxDotBackNum) {
		strDigit.append(string(maxDotBackNum - strDotBackNum, '0'));
	}
	else if (straDotBackNum != maxDotBackNum) {
		straDigit.append(string(maxDotBackNum - straDotBackNum, '0'));
	}
	string addStr = add(strDigit, straDigit);
	string timStr = "1";
	timStr.insert(0, string(maxDotBackNum, '0'));
	timStr.insert(1, ".");
	return addStr = str = timDecimal(addStr, timStr);
}
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
string stringPow::pow(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	int i = atoi(stra.c_str());
	string powStr = i < 0 && '-' == str.front() ? "-1" : "1";
	i < 0 && '-' == str.front() ? (str = sub("0", str)) : "";
	for (; i; i < 0 ? i++ : i--) {
		if (i < 0) {
			divAssign(powStr, str);
		}
		else {
			timAssign(powStr, str);
		}
	}
	return this->last = powStr;
}
string stringPow::powAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	int i = atoi(stra.c_str());
	string powStr = i < 0 && '-' == str.front() ? "-1" : "1";
	i < 0 && '-' == str.front() ? (str = sub("0", str)) : "";
	for (; i; i < 0 ? i++ : i--) {
		if (i < 0) {
			divAssign(powStr, str);
		}
		else {
			timAssign(powStr, str);
		}
	}
	return this->last = str = powStr;
}
//stringSub.cpp
#include "stringSub.h"
string stringSub::getLast() {
	return this->last;
}
string stringSub::sub(string str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if ('-' != stra.front()) {
		stra.insert(0, "-");
	}
	else {
		for (int i = 0; i < stra.size() - 1; i++) {
			stra[i] = stra[i + 1];
		}
		stra.pop_back();
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return this->last;
}
string stringSub::subAssign(string& str, string stra) {
	this->last.clear();
	int addNum = 0;
	int ix = 0;
	int iy = 0;
	int id = 0;
	int toDel = 0;
	string tempstr;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if ('-' != stra.front()) {
		stra.insert(0, "-");
	}
	else {
		for (int i = 0; i < stra.size() - 1; i++) {
			stra[i] = stra[i + 1];
		}
		stra.pop_back();
	}
	if (abs(atoi(stra.c_str())) > abs(atoi(str.c_str()))) {
		str.swap(stra);
	}
	auto it = str.crbegin();
	auto ita = stra.crbegin();
	bool itIsZero = !str.size();
	bool itaIsZero = !stra.size();
	bool strIsNegative = (str.size() ? '-' == str.front() : false);
	bool straIsNegative = (stra.size() ? '-' == stra.front() : false);
	bool tenSub = 1 == strIsNegative + straIsNegative;
	int absStr = abs(atoi(str.c_str()));
	int absStra = abs(atoi(stra.c_str()));
	bool isNegative = '-' == (absStr > absStra ? str.front() : absStr == absStra ? false : stra.front());
	int digitNum = 0;
	while (!itaIsZero || !itIsZero || addNum) {
		if (str.crend() == it || '0' > *it || '9' < *it) {
			itIsZero = true;
		}
		if (stra.crend() == ita || '0' > *ita || '9' < *ita) {
			itaIsZero = true;
		}
		ix = (1 - 2 * strIsNegative) * (itIsZero ? 0 : *it++ - '0');
		iy = (1 - 2 * straIsNegative) * (itaIsZero ? 0 : *ita++ - '0');
		digitNum = (tenSub && abs(ix) < abs(iy)) ? 10 + abs(ix) - abs(iy) : ix + iy;
		digitNum += !(0 > addNum && 2 == itIsZero + itaIsZero) * (1 - 2 * (digitNum < 0)) * addNum;
		addNum = tenSub && abs(ix) < abs(iy) ? -1 : digitNum / 10;
		digitNum = abs(digitNum % 10);
		if (!itIsZero || !itaIsZero || addNum || digitNum) {
			this->last.insert(this->last.begin(), '0' + digitNum);
		}
	}
	if (this->last.empty()) {
		this->last.push_back('0');
	}
	else if (isNegative) {
		this->last.insert(this->last.begin(), '-');
	}
	while ('-' == this->last[id] && id < this->last.size()) {
		id++;
	}
	while (id < this->last.size() - 1 && '0' == this->last[id]) {
		toDel = 0;
		while (toDel < this->last.size()) {
			if (toDel == id && ++toDel) {
				continue;
			}
			tempstr.push_back(this->last[toDel++]);
		}
		this->last = tempstr;
	}
	return str = this->last;
}
//stringTim.cpp
#include "stringTim.h"
string stringTim::tim(string str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	if (abs(atoi(str.c_str())) < abs(atoi(stra.c_str()))) {
		str.swap(stra);
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	this->last = timStr;
	return timStr;
}
string stringTim::timAssign(string& str, string stra) {
	string timStr = "0";
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	if (abs(atoi(str.c_str())) < abs(atoi(stra.c_str()))) {
		str.swap(stra);
	}
	bool isNegative = 1 == ('-' == str.front()) + ('-' == stra.front()) && (atoi(str.c_str()) && atoi(stra.c_str()));
	int i = abs(atoi(stra.c_str()));
	'-' == str.front() ? str = sub("0", str) : "";
	for (; i; i--) {
		timStr = add(timStr, str);
	}
	if (isNegative) {
		timStr.insert(0, "-");
	}
	str = this->last = timStr;
	return timStr;
}
string stringTim::getLast() {
	return this->last;
}
//stringTimDecimal.cpp
#include "stringTimDecimal.h"
string stringTimDecimal::getLast() {
	return this->last;
}
string stringTimDecimal::timDecimal(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = timStr;
}
string stringTimDecimal::timDecimalAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = str = timStr;
}
*///已更改删除str或stra多余字符的条件^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include <set>
using namespace std;

int main() {
    stringPlus sp;
    cout << sp.add("1-0", "1-9") << endl;
    return 0;
}
*///已再次测试刚才异常的计算现在是否正常^
/*
//stringTimDecimal.cpp
#include "stringTimDecimal.h"
string stringTimDecimal::getLast() {
	return this->last;
}
string stringTimDecimal::timDecimal(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("\\.?0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = timStr;
}
string stringTimDecimal::timDecimalAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	string strDigit = "";
	string straDigit = "";
	for (char ch : str) {
		if ('.' != ch) {
			strDigit.push_back(ch);
		}
	}
	for (char ch : stra) {
		if ('.' != ch) {
			straDigit.push_back(ch);
		}
	}
	regex dotRegex("\\.");
	bool hasDot = regex_search(str, dotRegex);
	bool hasDota = regex_search(stra, dotRegex);
	int dotBackNum = hasDot * (str.size() - 1 - str.find('.')) + hasDota * (stra.size() - 1 - stra.find('.'));
	bool canDelete = true;
	string timStr = tim(straDigit, strDigit);
	while (timStr.size() <= dotBackNum) {
		timStr.insert(0, "0");
	}
	int dotIndex = timStr.size() - dotBackNum;
	regex correntNumRegex("\\.?0+$");
	timStr.insert(dotIndex, ".");
	if (regex_search(timStr, dotRegex)) {
		timStr = regex_replace(timStr, correntNumRegex, "");
	}
	return this->last = str = timStr;
}
*///已修改stringTimDecimal类的timDecimal方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include <set>
using namespace std;
int main() {
    stringSubDecimal spd;
    cout << spd.subDecimal("1.23", "0.23") << endl;
    cout << spd.subDecimal("1.230", "0.23") << endl;
    cout << spd.subDecimal("1.23", "0.230") << endl;
    return 0;
}
*///已测试stringSubDecimal类的subDecimal方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include <set>
using namespace std;
int main() {
    string calc = "0.1";
    stringPlusDecimal spd;
    stringSubDecimal ssd;
    cout << spd.addDecimalAssign(calc, "0.23") << endl;
    cout << ssd.subDecimalAssign(calc, "0.13") << endl;
    return 0;
}
*///已试stringPlusDecimal类的addDecimalAssign方法和stringSubDecimal类的subDecimalAssign方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include <set>
using namespace std;
int main() {
    string calc = "0.1";
    stringPlusDecimal spd;
    stringSubDecimal ssd;
    stringTimDecimal std;
    cout << std.timDecimalAssign(calc, "10.1") << endl;
    return 0;
}
*///已再试stringTimDecimal类的timDecimalAssign方法^
/*
//stringPowDecimal.h
#pragma once
#include "stringTimDecimal.h"
class stringPowDecimal : protected stringTimDecimal {
	string last;
public:
	string getLast();
	string powDecimal(string str, string stra);
	string powDecimalAssign(string& str, string stra);
};


//stringPowDecimal.cpp
#include "stringPowDecimal.h"
string getLast() {

}
string powDecimal(string str, string stra) {

}
string powDecimalAssign(string& str, string stra) {

}
*///已新建stringPowDecimal类^
/*
//stringPowDecimal.cpp
#include "stringPowDecimal.h"
string stringPowDecimal::getLast() {
	return this->last;
}
string stringPowDecimal::powDecimal(string str, string stra) {

}
string stringPowDecimal::powDecimalAssign(string& str, string stra) {

}
*///已实现stringPowDecimal类的简单方法^
/*
//stringPowDecimal.h
#pragma once
#include "stringSubDecimal.h"
class stringDivDecimal : protected stringSubDecimal {
protected:
	string last;
public:
	string getLast();
	string divDecimal(string str, string stra, int maxDecimalNum);
	string divDecimalAssign(string& str, string stra, int maxDecimalNum);
};


//stringPowDecimal.cpp
#include "stringDivDecimal.h"
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, int maxDecimalNum) {

}
string stringDivDecimal::divDecimalAssign(string& str, string stra, int maxDecimalNum) {
	
}
*///已修改方法参数^
/*
//stringPowDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum = 10) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		int StrDotPos = str.size() > str.find('.') ? (str.size() + StraDecimalNum - 1) : (str.find('.') + StraDecimalNum);
		str.append(string(StrDotPos >= str.size() ? StrDotPos - str.size() + 1 : 0, '0'));
		str = regex_replace(str, dotRegex, "");
		str.insert(StrDotPos, ".");
	}
	int DecimalNum = 0;
	string DivStr = "";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atoi(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0');
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum = 10) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && '.' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && '.' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		int StrDotPos = str.size() > str.find('.') ? (str.size() + StraDecimalNum - 1) : (str.find('.') + StraDecimalNum);
		str.append(string(StrDotPos >= str.size() ? StrDotPos - str.size() + 1 : 0, '0'));
		str = regex_replace(str, dotRegex, "");
		str.insert(StrDotPos, ".");
	}
	int DecimalNum = 0;
	string DivStr = "";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atoi(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0');
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = str = DivStr;
}
*///已实现stringDivDecimal类方法^
/*
//stringDivDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotDef = !dotDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		int StrDotPos = str.size() > str.find('.') ? (str.size() + StraDecimalNum - 1) : (str.find('.') + StraDecimalNum);
		str.append(string(StrDotPos >= str.size() ? StrDotPos - str.size() + 1 : 0, '0'));
		str = regex_replace(str, dotRegex, "");
		str.insert(StrDotPos, ".");
	}
	int DecimalNum = 0;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotDef = !dotDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		int StrDotPos = str.size() > str.find('.') ? (str.size() + StraDecimalNum - 1) : (str.find('.') + StraDecimalNum);
		str.append(string(StrDotPos >= str.size() ? StrDotPos - str.size() + 1 : 0, '0'));
		str = regex_replace(str, dotRegex, "");
		str.insert(StrDotPos, ".");
	}
	int DecimalNum = 0;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = str = DivStr;
}
*///已消除stringDivDecimal类方法的bug^
/*
//stringDivDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 0;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 0;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (!DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = str = DivStr;
}
*///已再次清理bug^
/*
//stringDivDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str())) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string(DivStr.size() - 1 - DivStr.find('.'), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = str = DivStr;
}
*///修正stringDivDecimal类方法保留小数位数错误的bug^
/*
//stringDivDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str()) || DecimalNum > maxDecimalNum + 1) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string((DivStr.find('.') < DivStr.size()) * (DivStr.size() - 1 - DivStr.find('.')), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() ? str = "0" : "";
	!stra.size() ? stra = "0" : "";
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str()) || DecimalNum > maxDecimalNum + 1) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string((DivStr.find('.') < DivStr.size()) * (DivStr.size() - 1 - DivStr.find('.')), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	return this->last = str = DivStr;
}
*///已修正四舍五入错误bug^
/*
//stringDivDecimal.cpp
#include "stringDivDecimal.h"
void stringDivDecimal::swap(char& ch, char& cha) {
	char temp = ch;
	ch = cha; 
	cha = temp;
}
string stringDivDecimal::getLast() {
	return this->last;
}
string stringDivDecimal::divDecimal(string str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() || !atoi(str.c_str()) ? str = "0" : "";
	!stra.size() || !atoi(str.c_str()) ? stra = "0" : "";
	bool isNegative = 1 == (('-' == str.front()) + ('-' == stra.front()));
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$|^-");
	str = regex_replace(str, delRegex, "");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str()) || DecimalNum > maxDecimalNum + 1) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string((DivStr.find('.') < DivStr.size()) * (DivStr.size() - 1 - DivStr.find('.')), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	if (isNegative) {
		DivStr.insert(0, "-");
	}
	return this->last = DivStr;
}
string stringDivDecimal::divDecimalAssign(string& str, string stra, size_t maxDecimalNum) {
	bool dotDef = true;
	bool dotaDef = true;
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('.' == str[index] && (dotDef = !dotDef)) && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('.' == stra[index] && (dotaDef = !dotaDef)) && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	!str.size() || !atoi(str.c_str()) ? str = "0" : "";
	!stra.size() || !atoi(str.c_str()) ? stra = "0" : "";
	bool isNegative = 1 == (('-' == str.front()) + ('-' == stra.front()));
	regex dotRegex("\\.");
	regex delRegex("\\.?0*$|^-");
	str = regex_replace(str, delRegex, "");
	stra = regex_replace(stra, delRegex, "");
	if ("0" == stra) {
		cout << "错误：不能除以0" << endl;
		exit(1);
	}
	if (stra.find('.') < stra.size()) {
		int StraDecimalNum = stra.size() - stra.find('.') - 1;
		stra = regex_replace(stra, dotRegex, "");
		string timNum(StraDecimalNum, '0');
		timNum.insert(0, "1");
		timDecimalAssign(str, timNum);
	}
	int DecimalNum = 1;
	string DivStr = "0";
	string DecimalStr = "0";
	while (atoi(str.c_str()) >= atoi(stra.c_str())) {
		subDecimalAssign(str, stra);
		addAssign(DivStr, "1");
	}
	while (atof(str.c_str()) || DecimalNum > maxDecimalNum + 1) {
		if (1 == DecimalNum && maxDecimalNum) {
			DivStr.push_back('.');
		}
		if (DecimalNum > maxDecimalNum + 1) {
			int num = DivStr.back() - '0';
			DivStr.pop_back();
			if (num >= 5) {
				string addStr = "1";
				addStr = regex_replace(addStr, regex("^"), string((DivStr.find('.') < DivStr.size()) * (DivStr.size() - 1 - DivStr.find('.')), '0'));
				addStr.insert(1, ".");
				addStr.insert(0, "-");
				subDecimalAssign(DivStr, addStr);
			}
			break;
		}
		DecimalStr = "0";
		timDecimalAssign(str, "10");
		while (atoi(str.c_str()) >= atoi(stra.c_str())) {
			subDecimalAssign(str, stra);
			addAssign(DecimalStr, "1");
		}
		DivStr.append(DecimalStr);
		DecimalNum++;
	}
	if (isNegative) {
		DivStr.insert(0, "-");
	}
	return this->last = str = DivStr;
}
*///已修正stringDivDeciaml类负数运算错误bug^
/*
//stringPow.cpp
#include "stringPow.h"
string stringPow::getLast() {
	return this->last;
}
string stringPow::pow(string str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	int i = atoi(stra.c_str());
	string powStr = i < 0 && '-' == str.front() ? "-1" : "1";
	i < 0 && '-' == str.front() ? (str = sub("0", str)) : "";
	for (; i; i < 0 ? i++ : i--) {
		if (i < 0) {
			divDecimalAssign(powStr, str);
		}
		else {
			timDecimalAssign(powStr, str);
		}
	}
	return this->last = powStr;
}
string stringPow::powAssign(string& str, string stra) {
	for (int index = 0; index < (str.size() > stra.size() ? str.size() : stra.size()); index++) {
		if (index < str.size() && ('-' != str[index] && ('0' > str[index] || '9' < str[index]) || index > 0 && '-' == str[index])) {
			str.erase(index);
		}
		if (index < stra.size() && ('-' != stra[index] && ('0' > stra[index] || '9' < stra[index]) || index > 0 && '-' == stra[index])) {
			stra.erase(index);
		}
	}
	if (!str.size()) {
		str = "0";
	}
	if (!stra.size()) {
		stra = "0";
	}
	int i = atoi(stra.c_str());
	string powStr = i < 0 && '-' == str.front() ? "-1" : "1";
	i < 0 && '-' == str.front() ? (str = sub("0", str)) : "";
	for (; i; i < 0 ? i++ : i--) {
		if (i < 0) {
			divDecimalAssign(powStr, str);
		}
		else {
			timDecimalAssign(powStr, str);
		}
	}
	return this->last = str = powStr;
}
*///已支持stringPow类方法小数的运算^
/*
//stringPowDecimal.cpp
#define _CRT_SECURE_NO_WARNINGS true
#include "stringPowDecimal.h"
string stringPowDecimal::getLast() {
	return this->last;
}
string stringPowDecimal::powDecimal(string str, string stra) {
	char s[10000] = "";
	sprintf(s, "%lf", pow(strtod(str.c_str(), nullptr), strtod(stra.c_str(), nullptr)));
	regex r("\\.?0+$");
	return regex_replace(string(s), r, "");
}
string stringPowDecimal::powDecimalAssign(string& str, string stra) {
	return this->last = str = powDecimal(str, stra);
}
*///已实现stringPowDecimal类的方法^
/*
//meiri.cpp
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
using namespace std;
int main() {
    stringPowDecimal p;
    string str = "4";
    cout << p.powDecimal("2", "0.5") << " " << p.powDecimalAssign(str, "0.50") << " " << str << endl;
    return 0;
}
*///已测试stringPowDecimal类的方法^
/*
#include <iostream>
#include <regex>
using namespace std;

int main() {
    string s = "1a2s3d";
    regex nums_regex("\\d+");
    sregex_iterator it(s.begin(), s.end(), nums_regex);
    sregex_iterator end;
    for (; it != end; it++) {
        cout << it->str() << endl;
    }
	return 0;
}
*///正则迭代器^
/*
#include <iostream>
#include <regex>
using namespace std;

int main() {
    string s = "abcd";
    regex r("..");
    sregex_iterator it(s.begin(), s.end(), r);
    sregex_iterator end;
    for (; it != end; it++) {
        cout << it->str() << endl;
    }
	return 0;
}
*///正则迭代器2^
/*
#include <iostream>
#include <regex>
using namespace std;

int main() {
    string s = "abcd";
    regex r(".{1,3}");
    sregex_iterator it(s.begin(), s.end(), r);
    sregex_iterator end;
    for (; it != end; it++) {
        cout << it->str() << endl;
    }
	return 0;
}
*///正则迭代器3^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include <regex>
using namespace std;

int main() {
    string s = "abcdeytyewaaxbbnmcvkdfgb";
    unsigned int u_i = 0;
    cout << "几个为一组？" << endl;
    cin >> u_i;
    cout << endl;
    string rs = ".{1,";
    char num[10] = "";
    _itoa(u_i, num, 10);
    rs.append(num).append("}");
    regex r(rs);
    sregex_iterator it(s.begin(), s.end(), r);
    sregex_iterator end;
    for (; it != end; it++) {
        cout << it->str() << endl;
    }
	return 0;
}
*///字符串分组^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include <regex>
using namespace std;

int main() {
	string str = "00";
	str += "88";
	cout << str << endl;
	return 0;
}
*///字符串拼接1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include <regex>
using namespace std;

int main() {
	string str = "00";
	(str += "88") += "99";
	cout << str << endl;
	return 0;
}
*///字符串拼接2^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
using namespace std;
int main() {
    string str = "";
    cin >> str;
    string strf = "";
    string strb = "";
    stringPlus sp;
    bool bswitch = false;
    for (char ch : str) {
        if ('+' == ch && !bswitch) {
            bswitch = true;
        }
        else if (bswitch) {
            strb.push_back(ch);
        }
        else {
            strf.push_back(ch);
        }
    }
    cout << sp.add(strf, strb) << endl;
    return 0;
}
*///不复杂加法计算器^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
using namespace std;
int main() {
    string str = "";
    cin >> str;
    string strf = "";
    string strb = "";
    stringSub ss;
    bool bswitch = false;
    for (char ch : str) {
        if ('-' == ch && !bswitch) {
            bswitch = true;
        }
        else if (bswitch) {
            strb.push_back(ch);
        }
        else {
            strf.push_back(ch);
        }
    }
    cout << ss.sub(strf, strb) << endl;
    return 0;
}
*///不复杂减法计算器^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
using namespace std;
int main() {
    string str = "";
    cin >> str;
    string strf = "";
    string strb = "";
    stringTim ss;
    bool bswitch = false;
    for (char ch : str) {
        if ('*' == ch && !bswitch) {
            bswitch = true;
        }
        else if (bswitch) {
            strb.push_back(ch);
        }
        else {
            strf.push_back(ch);
        }
    }
    cout << ss.tim(strf, strb) << endl;
    return 0;
}
*///不复杂乘法计算器^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
using namespace std;
int main() {
    string str = "";
    cin >> str;
    string strf = "";
    string strb = "";
    stringDiv sc;
    bool bswitch = false;
    for (char ch : str) {
        if ('/' == ch && !bswitch) {
            bswitch = true;
        }
        else if (bswitch) {
            strb.push_back(ch);
        }
        else {
            strf.push_back(ch);
        }
    }
    cout << sc.div(strf, strb) << endl;
    return 0;
}
*///不复杂除法计算器^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
using namespace std;
int main() {
    array<int, 6>a = { 1, 2, 3 };
    cout << "a[0]：" << a[0] << " | a[1]：" << a[1] << " | a[4]：" << a[4] << endl;
    return 0;
}
*///array类的使用^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
using namespace std;
int main() {
    array<int, 6>a = { 1, 2, 3 };
    int arr[6] = {};
    memcpy(arr, a.data(), 24);
    cout << "arr[2]：" << arr[2] << endl;
    return 0;
}
*///array数组转为c数组^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
using namespace std;
int main() {
    array<int, 6>a = { 1, 2, 3 };
    a.fill(9);
    cout << "a[0]：" << a[0] << " | a[1]：" << a[1] << " | a[5]：" << a[5] << endl;
    return 0;
}
*///fill方法的使用^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
using namespace std;
int main() {
    array<int, 3>a = { 1, 2, 3 };
    cout << "a.front()：" << a.front() << " | a.back()：" << a.back() << endl;
    return 0;
}
*///用front和back方法获取array数组的开头和结尾^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    list<int>l;
    list<int>la;
    l.push_back(3);
    l.push_back(5);
    l.push_back(8);
    la.push_back(1);
    la.push_back(2);
    l.splice(l.cend(), la);
    for (int i : l) {
        cout << i << " ";
    }
    return 0;
}
*///list类的splice链接方法的使用1^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    list<int>l;
    list<int>la;
    l.push_back(3);
    l.push_back(5);
    l.push_back(8);
    la.push_back(1);
    la.push_back(2);
    auto it = l.begin();
    for (int i = 0; i < l.size() - 1; i++) {
        it++;
    }
    l.splice(it, la);
    for (int i : l) {
        cout << i << " ";
    }
    return 0;
}
*///list类的splice链接方法的使用2^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "abcdefg";
    cout << str.substr(1, 3) << endl;
    return 0;
}
*///截取string字符串类的子字符串1^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "abcdefg";
    for (int i = 0; i < str.size() - 2; i++) {
        cout << str.substr(i, 3) << endl;
    }
    return 0;
}
*///截取string字符串类的子字符串2^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "abcdefg";
    for (int ia = 0; ia <= str.size(); ia++) {
        for (int i = 0; i < str.size() - ia; i++) {
            cout << str.substr(i, ia + 1) << endl;
        }
    }
    return 0;
}
*///获取str字符串的所有子串^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str;
    for (char ch = 33; ch <= 126; ch++) {
        str.push_back(ch);
    }
    for (int ia = 0; ia <= str.size(); ia++) {
        for (int i = 0; i < str.size() - ia; i++) {
            cout << str.substr(i, ia + 1) << endl;
        }
    }
    return 0;
}
*///获取较长字符串str的所有子串^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str;
    set<string>strs;
    for (char ch = 33; ch <= 126; ch++) {
        str.append(string(2, ch));
    }
    for (int ia = 0; ia <= str.size(); ia++) {
        for (int i = 0; i < str.size() - ia; i++) {
            strs.insert(str.substr(i, ia + 1));
        }
    }
    for (string str : strs) {
        cout << str << endl;
    }
    return 0;
}
*///获取str的全部不重复子串^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = " 11s1o5l4xcc";
    cout << str.find_first_of('c') << " " << str.find_first_not_of('c') << " " << str.find_last_of('c') << " " << str.find_last_not_of('c') << endl;
    cout << str.find_first_of('0') << endl;
    return 0;
}
*///string类的查询方法^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = " 11s1o5l4xcc";
    cout << str.find_first_of("cc") << " " << str.find_last_of("o5l") << endl;
    return 0;
}
*///string类的查询方法2^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = " 11s1o5l4xcc";
    cout << str.find_first_not_of("cc") << " " << str.find_last_not_of("ooo") << endl;
    return 0;
}
*///string类的查询方法3^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaabbbccddeeff";
    cout << str << endl;
    str.erase(0, 1);
    cout << str << endl;
    str.erase(0);
    cout << str << endl;
    return 0;
}
*///string类的erase方法1^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaabbbccddeeff";
    int size = 1;
    while (str.size()) {
        cout << str << endl;
        if (size <= str.size()) {
            str.erase(0, size);
        }
        else {
            str.erase(0);
        }
        size++;
    }
    return 0;
}
*///string类的erase方法2^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaabbbccddeeff";
    int i = 0;
    for (; i < str.size(); i++) {
        str.erase(i, 1);
    }
    cout << str;
    return 0;
}
*///删除偶数位的字符^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaabbbccddeeff";
    int i = 2;
    for (; i < str.size(); i += 2) {
        str.erase(i, 1);
    }
    cout << str;
    return 0;
}
*///删除位数为3的倍数的字符^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaabbbccddeeff";
    int i = 0;
    for (; i < str.size(); ) {
        if ('a' == str[i]) {
            str.erase(i, 1);
        }
        else {
            i++;
        }
    }
    cout << str;
    return 0;
}
*///删除字符串中所有的字符a^
/*
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
int main() {
    string str = "aaaaddbbbccddeeffeee";
    int i = 0;
    char f = str.front();
    char b = str.back();
    for (; i < str.size(); ) {
        if (f == str[i] || b == str[i]) {
            str.erase(i, 1);
        }
        else {
            i++;
        }
    }
    cout << str;
    return 0;
}
*///删除原字符串中的第一个字符及最后一个字符^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
int main() {
    cout << VectorToString({ 1, 2, 3 }, "{", ", ", "}") << endl;
    return 0;
}
*///数组格式化转字符串1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
int main() {
    cout << VectorToString({ 1, 2, 3 }, "[\"", "\", \"", "\"]") << endl;
    return 0;
}
*///数组格式化转字符串2^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << stringSplit("1235678890", "[\"", "\", \"", "\"]") << endl;
    return 0;
}
*///字符串格式化分裂1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << stringSplit("wHHHyyyyyyii!!!ii", "{\'", "\', \'", "\'}") << endl;
    return 0;
}
*///字符串格式化分裂2^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << stringSplit(stringSplit("wHHHyyyyyyii!!!ii", "", ", ", ""), "", ", ", "") << endl;
    return 0;
}
*///字符串格式化分裂3^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << stringSplit(stringSplit("aaaaaaaaaaaaaaa", "B", "B", ""), "B", "B", "") << endl;
    return 0;
}
*///字符串格式化分裂4^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << stringSplit(stringSplit(stringSplit("aaaaaaaaaaaaaaa", "B", "B", ""), "B", "B", ""), "B", "B", "") << endl;
    return 0;
}
*///字符串格式化分裂5^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    string str = "9";
    int i = -1;
    while (i > 9 || i < 0) {
        cout << "几级? - ";
        cin >> i;
    }
    str[0] = i + '0';
    for (i--; i >= 0; i--) {
        str = stringSplit(str, string(1, i + '0'), string(1, i + '0'), string(1, i + '0'));
    }
    cout << str << endl;
    return 0;
}
*///生成完全二叉树^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 8, 2, 63, 32, 4, 65, 9 ,0, -7878 };
    cout << VectorToString(v, "(", " ", ")") << endl;
    return 0;
}
*///C++数组转shell数组^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 8, 2, 63, 32, 4, 65, 9, 0, -7878 };
    cout << VectorToString(v, "", "\n", "\n") << endl;
    return 0;
}
*///转置数组^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 8, 2, 63, 32, 4, 65, 9, 0, -7878 };
    cout << VectorToString(v, "", " -> ", "") << endl;
    return 0;
}
*///以链式显示数组^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v(8, 0);
    for (int i = 0, ia = 0; i < 8; i++) {
        cin >> ia;
        v[i] = ia;
    }
    cout << VectorToString(v, "vector<int>v = { ", ", ", " };") << endl;
    return 0;
}
*///以定义数组的形式显示数组^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v;
    cout << all_of(v.begin(), v.end(), [=](auto){return true; }) << endl;
    return 0;
}
*///all_of函数^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 1, 5, 7, 6, 3 };
    cout << all_of(v.begin(), v.end(), [=](int i){return i >= 5; }) << endl;
    return 0;
}
*///all_of函数的运用^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << to_string(-111) << endl;
    return 0;
}
*///数字转字符串函数to_string (1)^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    cout << to_string(4434343.6554455) << endl;
    return 0;
}
*///数字转字符串函数to_string (2)^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    unordered_map<int, int>t;
    t[0] = 3;
    t[7] = 2;
    cout << t[0] << " " << t[7] << endl;
    return 0;
}
*///unordered_map哈希表1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    unordered_map<string, int>t;
    t["aa"] = 3;
    t["gg"] = 2;
    cout << t["aa"] << " " << t["gg"] << endl;
    return 0;
}
*///unordered_map哈希表2^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 2,5,5,5,34 };
    reverse(v.begin(), v.end());
    for (int i : v) {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}
*///reverse函数1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 1, 2, 3, 4, 5 };
    reverse(v.begin(), v.end() - 2);
    reverse(v.begin() + 2, v.end());
    for (int i : v) {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}
*///reverse函数2^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 1, 2, 3, 4, 5 };
    vector<int>va = { 0, 0, 0, 0, 0 };
    transform(v.begin(), v.end(), v.begin(), [=](int i) -> int {return i + 1; });
    for (int i : v) {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}
*///v里的所有元素自增1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    vector<int>v = { 1, 2, 3, 4, 5 };
    vector<int>va = { 6, 7, 4, 3, 2 };
    transform(v.begin(), v.end(), va.begin(), v.begin(), [=](int i, int ia) -> int {return i + ia; });
    for (int i : v) {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}
*///v里的所有元素自增索引与之对应的va的元素^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    string str = "abababbzaa";
    cout << str.find("babb") << endl;
    return 0;
}
*///find方法查找字符串1^
/*
#define _CRT_SECURE_NO_WARNINGS true
#include <iostream>
#include "stringPlus.h"
#include "stringSub.h"
#include "stringTim.h"
#include "stringDiv.h"
#include "stringMod.h"
#include "stringPow.h"
#include "stringTimDecimal.h"
#include "stringPlusDecimal.h"
#include "stringSubDecimal.h"
#include "stringDivDecimal.h"
#include "stringPowDecimal.h"
#include <set>
#include <array>
#include <list>
#include <unordered_map>
using namespace std;
string VectorToString(vector<int> list, string front, string split, string back) {
    char* str = new char[12];
    for (int i = 0; i < list.size(); i++) {
        sprintf_s(str, 12, "%d", list[i]);
        front += str;
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    delete[] str;
    return front;
}
string VectorToString(vector<string> list, string front, string split, string back) {
    for (int i = 0; i < list.size(); i++) {
        front += list[i];
        if (i == list.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
string stringSplit(string str, string front, string split, string back) {
    for (int i = 0; i < str.size(); i++) {
        front += str[i];
        if (i == str.size() - 1) {
            front += back;
        }
        else {
            front += split;
        }
    }
    return front;
}
int main() {
    string str = "abababbzaa";
    cout << str.find_last_of("baba") << endl;
    return 0;
}
*///find方法查找字符串2^(从今往后不再更新)